0
0

Hi,

I am trying to loop a stream manually. I mean… I want it to stop when it completes playing once, but I want to be able to start it again. Currently, if I create the stream with FMOD_LOOP_OFF (or setLoopCount(0) ), when the sound is finished I am unable to start playing it again. If I do it just repeats one second of the sound forever. And if I create it with FMOD_LOOP_NORMAL I can’t tell when the sound restarts to stop it… Some help, please :)

Thanks,
bobef

  • You must to post comments
0
0

im not sure whether i understand your problem correctly, but it is relate to playing contrl and you want to contrl song’s playing with your code rather than using FMOD_LOOP_OFF, right?

Try to use Sound::getLength and then Channel::getPosition, I implemented playing songs in loop in this way.

sound->getLength(&length, FMOD_TIMEUNIT_MS);
while(1)
{
sound->getPosition(&position, FMOD_TIMEUNIT_MS);
if(position==length)
{
result = system->playSound(FMOD_CHANNEL_FREE, sound, false, 0);
ERRCHECK(result);
…………………..
}
}

  • You must to post comments
0
0

You just need pause the audio, then rewind to the start of the file. You should be able to restart it again no probs.

  • You must to post comments
0
0

[quote="jayDC":2dkh5got]You just need pause the audio, then rewind to the start of the file. You should be able to restart it again no probs.[/quote:2dkh5got]

Thanks. It worked this way.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.