How to properly set the range of a sound that can be heard?

Hello, so I’m not really sure what category this belongs in, I’d assume Scripting because it’s regarding the Sound class, if this belongs somewhere else let me know.

But basically, I noticed Roblox released a change to the Sound object, getting rid of the EmitterSize property. Go figure, this change completely screwed up my audio system I had in place for my game, and when I played it recently about half the sounds couldn’t be heard at all.

I’ve been trying to figure out how to use the properties that took EmitterSize’s place to achieve a similar effect as before, but it’s been horrible so far. Any help appreciated, thanks.

4 Likes

You may be thinking about RollOffMaxDistance.

2 Likes

So I’m reviving this post. The new RollOff properties seem really hard to figure out. I’m trying to properly configure the sound’s range for different sounds on different models, and it’s either way too quiet when I get close to it or way too loud when I’m very far away from it or up close as well…it’s really stupid.

Any help appreciated, thanks

1 Like

Just mess around with volume and RollOffMaxDistance until you get the results you like.

2 Likes

I’m bumping this again. I’m having serious issues getting this to work right, for whatever reason the sound playing from a part gets louder when I walk away from it, and when I get up close to it, it actually gets a bit quieter.

So either Roblox screwed up sounds, or I’m doing something wrong.

Not gonna lie, I find it insanely frustrating how they decide it’s okay to deprecate a property that works fine with some new untested property that’s just a giant mess right now.

2 Likes

The sound is always going to get quieter the farther you get from it, with all of the rolloff modes.

This makes me think that either the emitter is not where you think it is, or that you’re expecting it use emitter-to-avatar distance, when in fact it’s always emitter-to-camera distance that is used.

Also, while the properties have been renamed again, the math is still the same. RollOffMinDistance is what used to be EmitterSize, and RollOffMaxDistance is what used to be MaxDistance.

1 Like

This is the graph I made a couple of years back in Desmos for my own reference. It shows what the rolloff curves look like between the Min and Max distances. One thing particular to note is that the Inverse rolloff does not go to zero, so when you go outside of the max distance, sound can abruptly cut off. It’s for this reason that I use Inverse Tapered almost exclusively.

48 Likes

An older thread, but I was experiencing the same issue.

It looks like PlayOnRemove may not properly respect rolloff ranges. Any chance this is what you were using @C_Sharper?

I don’t know if this is a new issue or not, but hopefully this tidbit helps future peoples.

2 Likes

Would you mind providing the functions you used for these graphs? I can’t find them anywhere.

2 Likes

What functions are you referring to? Inverse, inverse tapered, linear, etc.?

I think the graphs were pulled from roblox data they look strangely familiar.

In order to make a graph like that in Desmos you have to have the mathematical function for the graphed line. That’s the function I need.

In case you are still interested - and for the sake of completion in case people stumble upon this topic - I believe these are the corresponding formulas.

EDIT: I spoke a bit too soon. EmeraldSlash helped me find the correct formulas for each of the roll-off modes. He documented them in this post!

Old post

The formulas are a bit messy and could probably be simplified, but they should display the correct behavior. The formulas for ‘inverse’ and ‘linear’ were pulled from the fmod website’s documentation. Linear square should just be the linear formula, but squared. The only bit of doubt I have is the formula for ‘inverse tapered’. The Roblox documentation mentions it interpolates between ‘inverse’ and ‘linear square’, but there is no information on the kind of interpolation, so I assumed a simple linear interpolation was used.

I should also mention my graph for the ‘inverse’ fall-off slightly differs from Emily’s graph. Although I don’t know what Emily used, I followed the description from the fmod documentation:

When FMOD uses this model, ‘mindistance’ of a Sound / Channel, is the distance that the sound starts to attenuate from. This can simulate the sound being smaller or larger. By default, for every doubling of this mindistance, the sound volume will halve.
I interpreted this as ‘starting from the minimum distance, for every doubling of the distance, volume is halved’.

1 Like