I’m streaming from an mpeg file, and testing it over very slow media. To sync my video with audio, I’m calling Stream_GetTime() every now and again. However I’ve noticed that when I’ve had a buffer underrun (ie the sound’s been skipping merrily away), that Stream_GetTime() still returns a time similar to if it hadn’t skipped. Ie although only 90secs of the mpeg has played, its telling me that 2mins of it has. Am I getting this wrong, or is there any way around it?
- kr@m asked 15 years ago
Unfortunately that SetBufferSize isn’t really what I’m needing.
I’m feeding FMOD from my own buffer, and so would just have to enlarge that etc. Am I right in that Stream_GetTime() has problems after skipping, or is it something else I’m doing?
I tried setting FSOUND_SetPause whenever I was coming to the end of my buffer, but that didn’t seem to do the trick – does SetPause take a while to work or something?
Let me elaborate a bit more. I’m using a custom stream using SetFileCallbacks. Sometimes my Read callback will wait for a while because it is waiting for more data to come in. When this happens, fmod will keep cycling through its own buffer.
Using SetPaused(channel) in the Read callback when I know that I have to wait has helped (I’m now only 15 frames off instead of 500), but its still not right. Basically I need to know the amount of time that fmod has played of my input.
I hope I’ve explained myself a little better.
Please login first to submit.