Firelight Technologies FMOD Studio API
FMOD_DSP_PROCESS_CALLBACK
Alternative callback that replaces FMOD_DSP_READ_CALLBACK and FMOD_DSP_SHOULDIPROCESS_CALLBACK. Can be used to specify the output channel format at runtime rather than create time, and also supports multiple input/output buffers. This callback will be called twice per mix as it has a dual purpsoe. Once will be with op = FMOD_DSP_PROCESS_QUERY, and then depending on the return value of the query, if it is FMOD_OK it will call it again with FMOD_DSP_PROCESS_PERFORM.
C/C++ Syntax
FMOD_RESULT F_CALLBACK FMOD_DSP_PROCESS_CALLBACK(
FMOD_DSP_STATE *dsp_state,
unsigned int length,
const FMOD_DSP_BUFFER_ARRAY *inbufferarray,
FMOD_DSP_BUFFER_ARRAY *outbufferarray,
bool inputsidle,
FMOD_DSP_PROCESS_OPERATION op
);
Parameters
dsp_state
Pointer to the plugin state. The user can use this variable to access runtime plugin specific variables and plugin writer user data. Do not cast this to FMOD_DSP! The handle to the user created DSP handle is stored within the FMOD_DSP_STATE structure.
length
The length of the incoming and outgoing buffer in samples. To get the length of the buffer in bytes, the user must multiply this number by the number of channels coming in (and out, they may be different) and then multiply by 4 for 1 float = 4 bytes.
inbufferarray
Pointer to a FMOD_DSP_BUFFER_ARRAY structure which describes the incoming signal.
outbufferarray
Pointer to a FMOD_DSP_BUFFER_ARRAY structure which describes the outgoing signal.
inputsidle
This is true if no audio is being fed to this unit. Generally used when the FMOD_DSP_PROCESS_OPERATION is set to FMOD_DSP_PROCESS_QUERY, so the FMOD_DSP_PROCESS_PERFORM step can be skipped. Code can then either skip processing, or return silence. If the FMOD_DSP_PROCESS_OPERATION is set to set a countdown timer based on the tail length of their effect and then call FMOD_ERR_DSP_DONTPROCESS, or just immediately return FMOD_ERR_DSP_DONTPROCESS if no further processing is required.
op
Either FMOD_DSP_PROCESS_QUERY or FMOD_DSP_PROCESS_PERFORM. FMOD_DSP_PROCESS_QUERY is only for the purpose of returning FMOD_OK or FMOD_ERR_DSP_DONTPROCESS. Do not process data in this callback! If op is FMOD_DSP_PROCESS_PERFORM then process the input (optionally) and write to the output.
Return Values
If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.
Remarks
Return FMOD_ERR_DSP_SILENCE if the effect is generating silence, so FMOD's mixer can optimize the signal path and not process it any more.
See Also
- FMOD_DSP_PROCESS_OPERATION
- FMOD_DSP_READ_CALLBACK
- FMOD_DSP_SHOULDIPROCESS_CALLBACK
- FMOD_DSP_DESCRIPTION
Version 1.10.03 Built on Feb 1, 2018