For a variety of reasons, I would like to not loop a song, but still use FMOD_LOOP_NORMAL, so that when the song completes it doesn’t free the channel.
I took a look at FMOD_CHANNEL_CALLBACKTYPE_END, but this doesn’t seem to be called when a song is being looped. Is that true? Is there another way to accomplish this? Thanks!
- CuriousG asked 9 years ago
I’m not sure why you want to do that, but I’ll assume that you have a good reason
The best way I can think of to do this would be to use Sound::addSynchPoint() to add a sync point to the end of your sound. Then you can mute or pause the sound in the FMOD_CHANNEL_CALLBACKTYPE_SYNCPOINT case of the callback.
Hope that helps.
- Adiss answered 9 years ago
from memory; to us sync-point this way it needs to be set at audio_file_length – 1 but its been a while. also, (again from memory) you can re-use a channel by passing both the index and/or channel pointer in a playSound call. the index value can also be used to flag to say the pointer channel you are passing is to be (re)used. i’m guessing that the channel isn’t marked as unused in the pool, thus retained. of coarse, i too am curious as to why 😮
- sohla answered 9 years ago
Please login first to submit.