Hi,
I am having some trouble understanding the lifetime of a channel because I’ve seen two ways of playing a sound and holding onto it’s playback attributes. (My suspicion is that method #2 is correct, but it would be great to get validation or an even better channel management method)
Method #1 - Holding onto a channel indefinitely:
With this method the moment you load a fmod sound you would immediately play it paused in order to get a channel. From there you apply whatever settings you want and then “play”(unpause) the channel. Once the channel is completed playback (in the end FMOD_CHANNEL_CALLBACKTYPE_END
callback) you play the sound again in a paused state to reuse FMOD_CHANNEL_REUSE
the channel. Saving all the playback properties that were set earlier.
Method #2 - Hold the playback settings yourself, then fire and forget the channel:
Instead of the channel holding onto your playback properties for any length of time; you make your own datastructure and only set the properties on the channel once you are about to actually play the sound. (ie copy the properties from your class/struct and call fmod with all the changes). In this case you don’t need to care at all about whether the channel is stolen or not, if it is not valid simply ignore it.
Thank You,
-Brad