I’m using FSOUND_Stream_Create to create a custom stream. I need to synchronize the stream with video playback, but since it is a custom stream I can’t use FSOUND_Stream_GetTime. I’ve read that you can create a DSP unit and use the FSOUND_DSPCALLBACK to calculate the time, but since I’m new to fmod I don’t know exactly how to get the time in the callback function. Could anyone show me or point me to a short example please?
- QuestOfDreams asked 10 years ago
A DSP unit passes in how many samples there are to process. If for example the length passed into the callback was 1024, you can work out the time in seconds/milliseconds by dividing the length by the output rate.
ie 1024 / 44100 = 0.023 seconds or 23.21ms.
You could also do this in a custom stream by the way, but instead of the output rate you just use the rate of the stream.
Note you can get the time of a custom stream in FMOD Ex.
Please login first to submit.