I’ve been using FMOD to do the audio playback for a video player. In reading other threads and the documentation, I’ve found that the creating a DSP to generate the sound will provide the lowest latency.
To compare I’ve implemented both a sound with pcmreadcallback and a dsp. Both work, even the sound isn’t bad provided the decodebuffersize is fairly small (seems like I can get away with 3072 on my system without introducing skipping/choppiness).
I did run into a DSP bug with a video that has only 1 audio channel. I set my channels to 1 in the FMOD_DSP_DESCRIPTION and get a value of 1 in outchannels from my dsp callback. I write my one channel to the outbuffer. The sound plays back at twice the speed. If I interleave one 0 value float sample for everyone of my samples, it plays back at the appropriate speed. I suspect the system still sees/plays the dsp as a 2 channel sound even though I specified the dsp only has 1 channel. My inchannels are 2, outchannels 1.
Is this expected behaviour? If so, then I don’t think I understood the purpose of the channels field in FMOD_DSP_DESCRIPTION as it seems like I always need to output the number of inchannels into the outbuffer.
Could someone please clarify? If this is indeed the way to do it, then no problem I can keep my fix in place but I suspect I’ve got something wrong…
- Cirrus asked 10 years ago
- You must login to post comments