0
0

I have a stream, and it is playing. If I make it play a single time (with setMode(FMOD_LOOP_OFF)) I can argue when it is finished by polling isPlaying().
But if I set it to loop (with setMode(FMOD_LOOP_NORMAL)) and then back to normal, while it is playing, isPlaying() always gives a “true” even when the stream has finished and sound has stopped playing.

Am I doing something wrong here?

Also, I am a bit puzzled with Channel::setLoopCount(), Sound::setMode(FMOD_LOOP_X) and Channel::setMode(FMOD_LOOP_X). Which one have I to use in order to make my stream looping? All three of them?

thanks for any help,
Davide

  • You must to post comments
0
0

It seems I got it, setting

sound->setMode(FMOD_LOOP_NORMAL);
channel->setMode(FMOD_LOOP_NORMAL);

to turn looping on, and

sound->setMode(FMOD_LOOP_OFF);
channel->setMode(FMOD_LOOP_OFF);

to turn it off works as expected. If I remove the 2 sound->setMode isPlaying() stays true past the end of sound, and the end callback never fires.

This operations are done while the sound plays.

  • You must to post comments
0
0

Actually, if I want to change the looping behaviour of the sound while it plays I have to change the mode both in sound and channel.
Anyway, I have no problems setting them both, now that I know have to 😀

  • You must to post comments
0
0

Try this modified playstream example

[url:pk0o7y0t]http://www.cogitamus.it/varie/main.cpp[/url:pk0o7y0t]

and see what happens. I just added a switch to turn looping on and off while playing.

  • You must to post comments
0
0

Oh, I forgot: gcc 4.0, OSX 10.4.2, dual G5 2 GHz, fmod api 4.00.34 mac

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.