i have a problem with fmod: i want to stream mp3s, some of them very small (just a few kb). files whose size is bigger than the buffersize of fmod work without a problem. but files that are smaller do not, unless you append silence to their end to make them bigger. when opening the stream, fmod crashes.
i explain it to myself like this: the program tries to cache 95% of the buffersize value. because the file is to small, the buffer will never be filled. therefore fmod never begins playing.
i tried to use the FSOUND_Stream_GetLength function to find out the filesize and adjust the buffersize accordingly, but this function is only available AFTER the stream has been opened, so I dont even get that far.
any ideas? thanks a lot!
- Anonymous asked 14 years ago
i have wav files that are only 1 or 2kb and they play fine with a 1000ms stream buffer (132kb).[/quote:1myxh57d]
hmm i was not totally clear here: the buffer i am refering to ist the one that can be set through FSOUND_Stream_Net_GetBufferProperties, so it is the one specified in bytes AND NOT in msec.
one more thing i was not clear on: fmod does not CRASH, but it will FREEZE.
when i make the buffersize smaller accordingly, then small will files will play as well. and i even have the problem with the official VB example provided in your ZIP file (when i manually replace the CommonDialog1.FileName by a string pointing to the stream on the net).
a minimal example that does reproduce the problem would be:
Dim streamhandle As Long
Private Sub Command1_Click()
FSOUND_Init 44100, 32, 0
streamhandle = FSOUND_Stream_Open("http://www.xyz.com/path/filename.mp3", FSOUND_NORMAL, 0, 0)
FSOUND_Stream_Play FSOUND_FREE, streamhandle
Private Sub Command2_Click()
streamhandle = 0
thanks for your help!
Please login first to submit.