BASS_ChannelSetDSP

Sets a user DSP function on a stream, MOD music, or recording channel.

HDSP BASS_ChannelSetDSP(
    DWORD handle,
    DSPPROC *proc,
    void *user,
    int priority
);

Parameters

handleThe channel handle... a HSTREAM, HMUSIC, or HRECORD.
procThe callback function.
userUser instance data to pass to the callback function.
priorityThe priority of the new DSP, which determines its position in the DSP chain. DSPs with higher priority are called before those with lower.

Return value

If successful, then the new DSP's handle is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not a valid channel.
BASS_ERROR_ILLPARAMproc cannot be NULL.

Remarks

Use BASS_ChannelRemoveDSP or BASS_FXFree to remove a DSP function. That can be done at any time, including within the DSP function.

Multiple DSP functions may be used per channel, in which case the order that they are applied is determined by their priorities. The priorities can be changed via BASS_FXSetPriority. Any DSPs that have the same priority are applied in the order that they were given that priority.

DSP functions can be applied to MOD musics and streams, but not sample channels. If you want to apply DSP functions to a sample, BASS_SampleGetChannel can create a stream from a sample.

Additional options are available via the BASS_ChannelSetDSPEx function.

See also

BASS_ChannelLock, BASS_ChannelRemoveDSP, BASS_ChannelSetDSPEx, BASS_ChannelSetFX, BASS_FXSetPriority, BASS_CONFIG_FLOATDSP, DSPPROC callback