Hi Guys,
This has probably been answered, but I can’t find the answer.
I’m using (or trying to use) fmod with an mpeg decoder to play videos – ie the audio packets (mp3 format) get sent to fmod. I’ve implemented the file callbacks, with my own buffer and fmod streams etc.
However after about 10,000 bytes, Seek(SEEK_SET, 0) is called. I’m wondering why this would be, as it destroys the playback (the beginning of the buffer doesn’t exist any more etc, then it goes through with heaps of seeks everywhere). The playback is working as I can hear it for a short while.

I’m working with lots of threads (major nightmares), but all the fmod functions are called from the same thread (I think!). Any ideas would be great.

  • You must to post comments

Thanks Brett,
Yeah, it was my fault (too late at night!). I had completely forgotten about PlayFile, which of course seeks to the beginning.
It was showing all types of wierd errorsand seeks (it was trying to go right through the file by
Seek(1, SEEK_SET), Read(4), Seek(2, SEEK_SET), Read(4), etc
(if you can understand my notation), but I think it was problems with my threading (I’ve got more threads than the Cane Toads scored tries last night!).
Seems to be working a bit better now…sorry about the wild goose chase question.

Sorry about the multiple questions, but just one quick thing I need to clear up.
When using the file callbacks, what happens when the read callback doesn’t return the size of data asked for, or when fmod reaches the end of the stream? I’ve found that if I don’t keep up the data quick enough, it stops sending read callbacks, thereby hanging my program. Is this right? Any way to get around it?

P.S. I’ve been using your engine for a few years now in lots of languages and its still the best and easiest thing I’ve encountered 😀

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.