"PlaybackLoudness" keeps returning 0

So in short, this prints 0. Anyone know why?

local AU = Instance.new("Sound")
AU.Parent = workspace
AU.SoundId = "rbxassetid://"..ID
AU.Volume = 0.5
AU:Play()
wait(5)
print(AU.PlaybackLoudness)

PlaybackLoudness just seems generally broken and unreliable but I need to use it because Roblox seems to allow “Highly disturbing audio” in terms of loudness, pitch and everything else that these “trollish” sounds have.

Of course, if Roblox decided to moderate this kind of audio then people like me wouldn’t have to practically scan the audio for inappropriate content with APIs that hardly work.

Id like to point out that since this topic has been bumped, I was kinda salty back when I made this

3 Likes

There’s the off-chance in which you’re waiting to check PlaybackLoudness longer than the sound plays. It’s always been very reliable to me.

I’ve checked basic variables like that, and I’ve tried multiple audio ID’s, the audios I’m using are all over 60 seconds long.

Be careful what you wish for. That sounds like a huge headache for people legitimately trying to legitimately upload sounds.

5 Likes

Yeah, I’ve thought about that too. I guess it really comes down to would you rather have peoples ears bleed or take an extra few hours to upload an audio. Then again, if they are using a sound that’s considered that bad for a game, they are better off getting a new sound.

Mind giving us info on whether or not you can actually hear the sound and where the sound is playing?

The sound plays normally, no failed to load or anything.

It seems like PlaybackLoudness only works on the client. Are you reading it from the server?

Sidenote: it returned 0 when I played it in studio through the properties window, but returned the proper values when I did Sound:Play() first in the command bar.

2 Likes

Indeed, it seems to be a common problem. Many of the properties for audio don’t work on the server. Besides, the ‘proper’ way of doing it is to have all audio 100% local. The Server doesn’t actually play audio (Or could you imagine Roblox’s server room?), Roblox just made it more convenient for us to sync them using the server. Since FE though, they’ve been slowly withdrawing themselves from bad practices like that.

4 Likes

Disclaimer: I don’t actually have a super loud obnoxious audio to test with, so you’ll have to confirm this works yourself.

Is there any reason you can’t use an EqualizerSoundEffect and/or CompressorSoundEffect to make these audios less annoying?

There are quite a few obnoxious audios that so clearly were not in a grey area and should have been declined, but I’m pretty sure whatever you’re thinking of doing by scanning (unless you want to specifically turn the audio off for some reason) the audio can be achieved with the two objects above.

1 Like

I’m running it from a local script, i’ve also noticed that it works if you
do it from the command bar, but i cant seem to get it to work from a
localscript.

You will need to constantly update PlaybackLoudness.