Sets up a user DSP function on a stream, MOD music, or recording channel.
Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.18.0
Syntax
public static int BASS_ChannelSetDSP( int handle, DSPPROC proc, IntPtr user, int priority, BASSDSPType flags )
Parameters
- handle
- Type: SystemInt32
The channel handle... a HSTREAM, HMUSIC, or HRECORD. - proc
- Type: Un4seen.BassDSPPROC
The callback function (see DSPPROC). - user
- Type: SystemIntPtr
User instance data to pass to the callback function. - priority
- Type: SystemInt32
The priority of the new DSP, which determines it's position in the DSP chain - DSPs with higher priority are called before those with lower. - flags
- Type: Un4seen.BassBASSDSPType
A combination of these flags (BASSDSPType):BASS_DSP_BYPASS Set the DSP in a bypassed/paused state. Use BASS_FXSetBypass(Int32, Boolean) to start processing. BASS_DSP_FLOAT DSP function always wants floating-point sample data. 8/16-bit data will be converted before being passed to the DSP function, and then converted back again after (if BASS_DSP_READONLY is not set). BASS_DSP_FREECALL Call the DSP function with a NULL buffer when it is removed from the channel or the channel is freed. BASS_DSP_READONLY The DSP function does not modify the data. This lets BASS know that it does not need to copy back data from any temporary buffers, eg. used in floating-point conversion or mono/stereo channel separation. BASS_DSP_MONO_N(n) Apply the DSP to only the n'th channel (1 - 255). The DSP function will receive mono data. Use MakeBASSDSPTypeMono(Int32, Boolean) to construct this flag (including the BASS_DSP_STEREO_N one). BASS_DSP_STEREO_N Apply the DSP to only the channel given by BASS_DSP_MONO_N(n) and the one after it. The DSP function will receive stereo data.
Return Value
Type: Int32If succesful, then the new DSP's handle is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
This function is the same as BASS_ChannelSetDSP(Int32, DSPPROC, IntPtr, Int32) but with the additional flags options, so the remarks there also apply here.
When floating-point conversion is enabled via the BASS_DSP_FLOAT flag on adjacent DSPs in the DSP chain, the data will remain floating-point (rather than being converted back and forth) between them. If it is enabled on all DSPs then the data will remain floating-point throughout, like enabling the BASS_CONFIG_FLOATDSP option, except that BASS_CONFIG_FLOATDSP also applies to any effects set via BASS_ChannelSetFX(Int32, BASSFXType, Int32) and the BASS_ATTRIB_VOLDSP attribute.
| ERROR CODE | Description |
|---|---|
| BASS_ERROR_HANDLE | handle is not a valid channel. |
| BASS_ERROR_ILLPARAM | proc proc cannot be NULL. |
| BASS_ERROR_SPEAKER | The specified MONO or STEREO flag is invalid. |
See Also