3d min max distance

hello, I’ve encountered an issue with setting the min max distance of the channel group, the audio is still audible and way too loud even after going outside of the max distance.

Here’s what i’ve done so far,

m_StereoGroup->set3DMinMaxDistance(0.3f, 1.f);

I’m also updating the position of both listener and audio object in run time so the panning works. However, after going outside of the max distance, eg 1.0f, am i suppose to be able to hear the audio?

If that’s the case, is there a way for the listener to not be able to hear the audio after a certain range for stereo sounds? Thanks for the help :slight_smile:

When using 3D audio, the rolloff model you’re using determines how sounds attenuate with respect to distance. Enabling 3D audio as you’ve done with m_StereoGroup->setMode(FMOD_3D) sets the rolloff model to FMOD_3D_INVERSEROLLOFF by default, which stops attenuating sound at and beyond max distance - the sound will never be truly silent as attenuation with this rolloff model is calculated with mindistance / distance, though with enough distance a sound may be imperceptible.

To have silence when beyond maxdistance, you simply need to set the channel group to use an appropriate rolloff model. You can do this by calling m_StereoGroup->setMode() again, and setting the mode to FMOD_3D_LINEARROLLOFF, or FMOD_3D_LINEARSQUAREROLLOFF.

You can see more info regarding 3D sounds, distance and rolloff in FMOD under White Papers | 3D Sounds in the documentation.

omg yes thank you so much! I can’t believe I missed that part out on the documentations… Been looking all over for weeks