So far, I’ve been doing all my sound rolloffs manually by just changing the volume of each channel. I just discovered FMOD_3D_ROLLOFFCALLBACK and decided I would try to use this.
First, I have a few questions about this function.
1) The docs don’t explain what the function should return. I’m assuming a falloff value that will be used to multiply the volume in the range of 0.0 to 1.0?
2) The docs don’t tell me if this call back will potentially happen in another thread or only my main thread. It looks like it’s only being called from the main thread.. Is this a guarantee?
Second, I ran into a minor issue that I’m hoping to get some help with. When I call FMOD_System_PlaySound(), the rolloff call back triggers. Unfortunately, I haven’t had the opportunity yet to setup my user data on the channel by this point, so in the callback I don’t know what type of falloff curve to apply.
I considered putting some user data on the fmod sound, so I could get to this inside the callback, but this doesn’t work well because the rolloff settings aren’t sound-spcecific. In other words, I may potentially play the same sample multiple times with different rolloff settings.
It seems like there would be a couple ways to fix this:
1) In my case, I’m calling FMOD_System_Playsound() setting the "initially paused" flag to true. Would it be possible to delay the rolloff callback until the channel is resumed?
2) Is there some other way I can force fmod to recompute the rolloff for a specific channel? If so, I could do this before I resume my channel.
3) Would it be possible to pass through some user data to FMOD_System_Playsound() that will be attached to the channel before the callback is triggered?
- samc asked 10 years ago
- You must login to post comments