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
- bobef asked 9 years ago
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.
result = system->playSound(FMOD_CHANNEL_FREE, sound, false, 0);
- Ziming answered 9 years ago
Please login first to submit.