0
0

hello, i have a serious problem with FMOD 3.75. it won’t loop my MP3 correctly. there is a slight pause between the loop start and end point. even if i try to loop the whole song. why can’t FMOD prebuffer the beginning when it detects that the end of the stream is near and it has to be looped? i simply opened the file with:
[code:x27tvdta]FSOUND_Stream_Open(
LoadFileName,
FSOUND_LOOP_NORMAL|FSOUND_2D,
0, 0)
[/code:x27tvdta]
and played it with:
[code:x27tvdta]
FSOUND_Stream_Play(0, Stream)
[/code:x27tvdta]
i also tried to enlarge the buffer, but it did not do nothing. can anyone help me? thanks in advance.

  • You must to post comments
0
0

this is not fmod’s fault, it is the mp3. mp3 encoders put a frame of silence at the start of the file, you may want to look into an encoder with a -nogap option.

  • You must to post comments
0
0

thanks for the tip, but unfortunately it didn’t work. i’ve tried another encoder with the nogap feature, but the gap is still there. maybe it has become shorter now, but it is still there.
i wanted to use fmod to play mp3s as background music in my game. the songs consist of an intro and a loopable part. but if i can’t loop the song without the gap it is meaningless. sigh the windows mediaplayer also has this problem. is it really that hard to loop an mp3??? or has anyone else another idea about what i can do? maybe switch to another format?

  • You must to post comments
0
0

okay, i switched to the ogg format. now it works perfectly. However i still would like to know why it didn’t work with mp3.
And i have a final question: how can i calc the loop points?
i hardcoded this for testing purposes:
[code:257nyj98]
FSOUND_Stream_SetLoopPoints(Stream, 4 * 44100, 84 * 44100);
[/code:257nyj98]
but i don’t know how to obtain the number of samples per second at runtime.

  • You must to post comments
0
0

mp3 is not built to loop, it is as simple as that. Its a lossy one shot stream format.

To find the default rate of a stream use FSOUND_Stream_GetSample and FSOUND_Sample_GetDefaults.

  • You must to post comments
0
0

thanks. now it works perfectly. 😀

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.