0
0

Hi,

I have a question regarding channels and sounds. I just want to make sure that I understand it correctly.

As far as I can understand, FMOD::Sound is a sound loaded in memory (ignoring other methods like streaming for now) that can be used multiple times. So if I have a bullet sound that I loaded via System::createSound() I can use that several times by simply playing it on various channels.

Whenever I play a sound and allow FMOD to use a free channel, FMOD will give me back a channel ID (if successful) on which the sound is going to be playing. Now the channel can at any time be ‘stolen’ if it is of low priority and there are not enough channels around. To stop/increase-decrease volume/change-position and velocity of a playing sound on a specific channel, I get the channel via the system through the channel ID and call the appropriate functions.

So far so good. Now I am confused on how FMOD will handle the following scenario:

[quote:30elwp8z]I play a sound via a free channel and get its channel ID. I change the volume of the channel via the channel ID. A few frames later, I decide to STOP the channel playing a particular sound. This will work if the sound the channel is playing is the sound I started with. But what if the channel finished playing a sound, became invalid, then a new sound request was made, the same channel was selected to play the newly selected sound, and the channel started playing this new sound when I called the STOP function. How would I know that during this time the channel started playing a different sound and that I should not be stopping the channel anymore? This is just one scenario with this problem and I have been thinking of many other scenarios in a similar situation (character speaking a few dialogues and the system recycling a channel to play a new dialogue while I think that I am working with an older dialogue and increasing the volume/pitch/position etc. for example for the wrong dialogue)[/quote:30elwp8z]

  • You must to post comments
0
0

That is correct.

  • You must to post comments
0
0

Thanks for the reply. Okay, just so I understand this correctly, an invalid handle address remains invalid for the life of the program?

  • You must to post comments
0
0

Your handle will be invalidated when it is stolen. Even if the underlying channel (which was stolen) is reused, your handle remains invalid.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.