I need to know the attenuation formula that FMOD uses to determine when a looping sound should be cut off. How are rolloff factor, minimum sample distance, and distance of the listener from the sound source combined to produce the final output volume of a sample?
What I want is to be able to create an attenuation start distance and end distance. In other words, being able to tell a sample that I want it to start attenuating at 400 meters, and be completely cut off at 1000 meters (within that range it would attenuate logarithmically). The rolloff/min distance setup doesn’t seem to give me the behavior I want.
This is for the upcoming patch for Savage. Thanks for your help.
- s2sammy asked 14 years ago
Thanks. Actually I just went ahead and wrote my own attenuation code that refreshes the volume of each channel every frame according to the min/max distance settings. I set the rolloff factor to 0 so the panning gets set but not the volume.
Doppler should still work, no? As long as the velocity for the sound is set correctly, it shouldn’t matter what the rolloff setting is.
It seems like 5.1 should work also, because I’m still having all the code go through the 3d sound system. The only difference is that rolloff is 0 and I’m refreshing the volume of each channel every frame.
I agree that it’s probably not the ideal way to do things.
I will be sticking with this method forseeable future, though, until a newer version of fmod allows me to do the things I want with attenuation natively. I really love the simplicity of your library, but I do feel that the attenuation code leaves something to be desired.
Having the attenuation set up with a minimum and maximum radius setting and an exponential volume curve really seems like the right way to do things, and it sounds great. I hope that you strongly consider adding native support for this in the next major release of FMOD.
I’ll be happy to send along the new sound code for Savage if you think it would be valuable.
Please login first to submit.