0
0

Hi!

I write a programm, where stream loops are used. I do it using two streams of the same song, and when the first string is going to the end of the loop, the second starts at the begining of it, but it doesn’t work well, because counting of time isn’t precise! FMOD returns values dozens miliseconds too little or too much!

Does anybody know what should I do?

Janek

  • You must to post comments
0
0

You might need to use FSOUND_MPEGACCURATE when you call FSOUND_Stream_OpenFile(). AFAIK, that’s the only way to get accurate timing data.

  • You must to post comments
0
0

I know it very well. I’m working with constant bitrate mp3s and I needn’t use MPEGACCURATE flag. (I’ve tried it). Problem is that FMOD updates time every 25 ms and this is too much for me. I need 1 ms delay time counting. I did many test to get to know where is the problem, but this is hard to find the FMOD bugs.

Janek

  • You must to post comments
0
0

I wouldn’t call the 25ms counting a “bug” per se; FMOD counts based on the buffersize (I think default is 50ms, not 25) you could just set the buffersize to 1ms (FSOUND_SetBufferSize) and you’ll get accurate counting, but it’ll probably skip like mad.

[b:3d5dxzq6]edit[/b:3d5dxzq6] Hmmm… that won’t work–FMOD clamps the buffersize at 50. And as I suspected, this isn’t a bug. It’s even documented: “Due to this buffersize command latency on software channels will be between 25 and 50ms on average (37.5ms) when the buffersize is set to 50.” I’d say more a limitation than a bug. There’s nothing you can do.

  • You must to post comments
0
0

You say you are using stream loops…

Two things

1) Download FMOD 3.62 – there is support for changing the loop mode of streams (as you can with samples)

2) To loop streams (that are not opened as looping) do as:

// Open stream
FSOUND_STREAM* stream = FSOUND_Stream_OpenFile( “filename”, FSOUND_NORMAL, 0 );

// Set the loop mode
FSOUND_Stream_SetMode( stream, FSOUND_NORMAL | FSOUND_LOOP_NORMAL );

// Play the stream
int channel = FSOUND_Stream_Play( FSOUND_FREE, stream );

— To unset the loop mode of the stream use:

FSOUND_Stream_SetMode( stream, FSOUND_NORMAL | FSOUND_LOOP_OFF );

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.