There is a little problem:
The FMOD3.71 Media Player accepts the setting of the Loop-Checkbox only when it’s set before playing the file. So the problem doesn’t occur there.
I want to switch looping on and off during play of a file and I use FSOUND_Stream_SetMode(). To switch on I add FSOUND_LOOP_NORMAL and take away FSOUND_LOOP_OFF. To switch off I do the opposite.
That’s the only way I found that looping really stops when I switch it off. But unfortunately the FSOUND_LOOP_OFF stops the playback. Afterwards the FSOUND_Stream_GetTImeMs() gets the maxiumum time. Is it supposed to be like that?
- Prem asked 14 years ago
There is no way the stream would stop or change the time with a normal call to setloopmode because it does absolutely nothing but update the mode variable, and this is ONLY checked when the stream hits its end point. It doesnt affect the time, or playback of the stream at all.[/quote:2g1q01ea]
could you check this ? change the loop mode when sound are playing second or third (or more) times.
I’ve only quickly read this post, but I think I’m also having the same problem.
I’m playing a stream, and as long as it is only playing for the first time there is no problem, but if looping is on, and it has played completely at least one time then turning the looping off will result in the gettimems function not giving the current time in the stream.
When I then turn looping back on, the time is back correct.
- Adion answered 14 years ago
Yes, that was exactly what I also expected. And the problem is, that it does NOT play to the end, but stops immediately. As soon as the LOOP_OFF flag is set, the next FSOUND_Stream_GetTimeMs() returns the length of the piece. So I solved the problem now by taking the time before setting the flag and afterwards resetting the position to that time.
That’s my code:
itemMode = FSOUND_Stream_GetMode(currStream);
itemMode |= FSOUND_LOOP_NORMAL;
itemMode &= ~FSOUND_LOOP_OFF;
itemMode &= ~FSOUND_LOOP_NORMAL;
itemMode |= FSOUND_LOOP_OFF;
And it behaves on my Windows-XP Version 2002 with FMOD 3.71 as I said.
But it’s not really a problem anymore. I can reset the position after setting the loop off.
Please login first to submit.