Hi Brett

First let me congratulate you on a superb piece of programming! I have learned a lot, in the last two months using your FMOD library.

I wonder whether you might be able to help me now though as I seem to have hit a brickwall. I’ve spent many days looking at it from every angle, searching for potential workarounds and just trying to figure out exactly what is going on.

I open two streams of exactly the same MP3:

Then I play the streams at exactly the same time and as you would expect they are perfectly synchronised.
Next, I adjust the starting time of the second mp3 to 10ms and play them again. The songs are still perfectly synchronised which is not what I expected but figure it must be something to do with the buffer refresh rate!?

Here are some relevant calculations:

OutputRateHZ = 44100hz
BufferLength = FSOUND_DSP_GetBufferLength() = 1024
BufferMs = BufferLength / OutputRateHZ * 1000 = 23.219955ms
LatencyMs = FSOUND_DSP_GetBufferLengthTotal() / OutputRateHZ * 1000 = 185.759637ms

I try setting the 2nd song start time to 23ms and as predicted they are synchronised.
Then I set it to 24ms and anticpate a change however, they are still both perfectly synchronised!? I try 25ms and still the same, 26ms the same. But then, 27ms and suddenly they are out of step! By tuning the 2nd song by ear I find that it is 26ms out.

So, I predict that at 52ms it should still only be 26ms out and it is! At 53ms it should then be 52ms out and it is!

Here is the question:
Where does this 26ms come from? I have racked my brains trying to figure it out.

I initialise FMOD and use defaults apart from the Output set to FSOUND_OUTPUT_WINMM, (DirectSound also produces the same results, the reason I dont use it during development though is because if my software crashes without closing down FMOD properly, I have to reboot the machine to get it to work again.)

Any ideas?


  • You must to post comments


๐Ÿ˜ฅ ๐Ÿ˜ก :( ๐Ÿ˜• :) ๐Ÿ˜† ๐Ÿ˜€

You are an absolute 100% A1 star!!! Sorry for my being impatient earlier. ๐Ÿ˜ณ

Now all I need to do is add this ‘magic number’ to my code and hey presto. 8) Well, you never know lol.

Look forward to buying one of your commercial licenses in the very near future and hey, I’ll give you a copy for free. ๐Ÿ˜‰

Regards and Thanks


  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.