0
0

I am want to play streams (of wav, mp3, ogg) with high accuracity using fmod sound system. The trouble is that: there are scilences before the stream starts and after it ends. How to remove them? I can reduce their lehgth by passing small value to FSOUND_SetBufferSize(), but can not remove them totally. The other technick is to use FSOUND_Stream_GetTime() to determine when fmod starts playing 1th ms of stream, and when it plays last ms =FSOUND_Stream_GetLengthMs(). This way I can determine that stream starts playing after approximately 68 ms from calling FSOUND_Stream_Play(); the end of song is approximately 150 ms before fmod calls my EndCallback. Total ~200 or more millisecond between two successive sound tracks!!!
How to resolve this situation?

  • You must to post comments
0
0

It will be good for me if I’ll can prepare stream for playing and, when I call some function like FSOUND_SetPaused ( channel, FALSE ) strem begin to play immediately without of delays. And I want to determine when strem finished to play more exactly than the FSOUND_Stream_SetEndCallback () does.

  • You must to post comments
0
0

My source code (console win32 programm) is available at
http://www.rt.mipt.ru/~maa/fmod/main.cpp
to investigate delays before starting to play end after song is
finished to the call of the EndCallback.

Next some outputs of it while playing wav-file=10 second of white noise:
Outputs:
1. While FSOUND_BUFFERSIZE == 200
Stream length = 10000 ms.
416468 mks passed before starting of playing 23th ms of stream
470640 mks passed from finish of song to the call of the EndCallback
2. While FSOUND_BUFFERSIZE == 0 (I think the value of 50 ms is used in this case)
2.1.Stream length = 10000 ms.
31390 mks passed before starting of playing -22th ms of stream
74785 mks passed from finish of song to the call of the EndCallback
2.2.Stream length = 10000 ms.
66544 mks passed before starting of playing 23th ms of stream
93860 mks passed from finish of song to the call of the EndCallback

 With open type = FSOUND_HW2D
 1. While FSOUND_BUFFERSIZE == 200
      Stream length = 10000 ms.
      11871 mks passed before starting of playing 23th ms of stream
      74382 mks passed from finish of song to the call of the EndCallback
 2. While FSOUND_BUFFERSIZE == 0 (I think the value of 50 ms is used in this case)
      Stream length = 10000 ms.
      21945 mks passed before starting of playing 23th ms of stream
      72107 mks passed from finish of song to the call of the EndCallback

BUGS: EndCallback does not called!

I have mpeg files “onemoretime.mpg”, “Phantom of the Opera.mpg” and *.avi
files too. Their could not be played by fmod until I install ACE Mega
CoDecs Pack (“Unknown format” was reported). But I have trouble while
playing them: while I set the EndCallback (by function
FSOUND_Stream_SetEndCallback), it is not called after song playing
finished. At that, it is left the only one way to determine that song
finished to free resources and continue work – to compare
FSOUND_Stream_GetTime () with FSOUND_Stream_GetLengthMs ()
or to start Win32 timer. I have not such problem with wav and mp3 files.
Is there a bug in fmod or in decompressors from ACE Mega CoDecs Pack?

  • You must to post comments
0
0

In my previous c++ sample you can find the solution of using fmod for playing, for example, “twenty one” as connected speech if you have two files (wavs – “twenty” and “one”). In the sample you can distinct breakup while playing successivelly two wavs of white noise. But more long breakup will be obtained if we will using FSOUND_SetPaused ( channel2, FALSE ) from the EndCallBack. To test this, comment line 209 (“FSOUND_SetPaused ( channel2, FALSE ); channel2 = 0;”) and word “int” in the line 199.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.