As you know, the FMOD DSP read callback has a signature that looks like this:

FMOD_DSP_STATE * dsp_state,
float * inbuffer,
float * outbuffer,
unsigned int length,
int inchannels,
int outchannels

I was wondering under what circumstances a DSP might have different numbers of input and output channels. Or, more precisely, is this something I would ever have to worry about handling when using this callback to pass data to my own DSP objects?

Also, when perusing the FMOD source code for implementation guidance, I noticed that (in the delay dsp, for example) you were checking to see if the number of channels had changed dynamically, and reallocating buffers in that situation. Since I thought the output format couldn’t be changed after system::init() is called, I didn’t think DSPs would have to worry about this. What causes the number of channels passed to a DSP to change, and again, is that something I need to worry about with mine?

  • You must to post comments

The number of channels in a DSP depends on where in the DSP network the DSP is added. If you have a stereo file playing, and nothing in the DSP tree causes a mix to happen before your DSP node then you will receive 2 channels of data. If for instance you place your DSP after a submix (FMOD::ChannelGroup) and the output channel count is 6, then that same stereo data will have been up mixed to 6ch and as such you will get 6ch input to your DSP.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.