0
0

hi,

how would i change what sound a channel is playing in 3D? for example, i have two sounds loaded, sound1 and sound2. i have a single channel. i start playing a sound with

FMODResult = FMODSystem->playSound(FMOD_CHANNEL_FREE, sound1, true, &channel);

later, i want channel to play sound2 instead. is it possible to change the sound channel is playing? is it as simple as

FMODResult = FMODSystem->playSound(FMOD_CHANNEL_FREE, sound2, true, &channel);

thanks.

  • You must to post comments
0
0

What is happening here is you are not replacing the sound in that channel with the new sound. Instead you are playing a new sound and all the channels are handled internally. Your ‘channel’ variable is just a pointer to that channel new channel, the old one is still there.

That is the whole point of the FMOD_CHANNEL_FREE flag, you might want to try FMOD_CHANNEL_REUSE. Then it will be replacing the old sound with the new one. However it will not copy all the attributes like 3D position from the old channel. You will need to call set3Dattributes on the channel once you have called playSound.

  • You must to post comments
0
0

thanks for the swift response! 8)

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.