BASS_ChannelSetFX

Sets an effect on a stream, MOD music, or recording channel.

HFX BASS_ChannelSetFX(
    DWORD handle,
    DWORD type,
    int priority
);

Parameters

handleThe channel handle... a HSTREAM, HMUSIC, or HRECORD.
typeThe type of effect. One of the following, with optional flags.
BASS_FX_DX8_CHORUSDX8 Chorus. Use BASS_DX8_CHORUS structure to set/get parameters.
BASS_FX_DX8_COMPRESSORDX8 Compression. Use BASS_DX8_COMPRESSOR structure to set/get parameters.
BASS_FX_DX8_DISTORTIONDX8 Distortion. Use BASS_DX8_DISTORTION structure to set/get parameters.
BASS_FX_DX8_ECHODX8 Echo. Use BASS_DX8_ECHO structure to set/get parameters.
BASS_FX_DX8_FLANGERDX8 Flanger. Use BASS_DX8_FLANGER structure to set/get parameters.
BASS_FX_DX8_GARGLEDX8 Gargle. Use BASS_DX8_GARGLE structure to set/get parameters.
BASS_FX_DX8_I3DL2REVERBDX8 I3DL2 (Interactive 3D Audio Level 2) reverb. Use BASS_DX8_I3DL2REVERB structure to set/get parameters.
BASS_FX_DX8_PARAMEQDX8 Parametric equalizer. Use BASS_DX8_PARAMEQ structure to set/get parameters.
BASS_FX_DX8_REVERBDX8 Reverb. Use BASS_DX8_REVERB structure to set/get parameters.
BASS_FX_VOLUMEVolume level adjustment. Use BASS_FX_VOLUME_PARAM structure to set/get parameters.
BASS_FX_MONO_N(n)Flag: Apply the effect to only the n'th channel (1 = first).
BASS_FX_STEREO_N(n)Flag: Apply the effect to only the n'th channel and the one after it.
other effects may be supported by add-ons, eg. BASS_FX.
priorityThe priority of the new effect, which determines its position in the DSP chain. DSP/FX with higher priority are applied before those with lower.

Return value

If successful, then the new effect'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_ILLTYPEtype is invalid.
BASS_ERROR_NOFXThe specified DX8 effect is unavailable.
BASS_ERROR_FORMATThe channel's format is not supported by the effect.
BASS_ERROR_SPEAKERThe specified MONO or STEREO flag is invalid.
BASS_ERROR_UNKNOWNSome other mystery problem!

Remarks

Multiple effects may be used per channel. Use BASS_ChannelRemoveFX to remove an effect. Use BASS_FXSetParameters to set an effect's parameters. An effect's priority value can be changed via BASS_FXSetPriority.

DX8 effects are limited to stereo, so when they are used on a multi-channel stream, BASS will split the data into stereo streams (plus a mono one for odd numbers) for processing by multiple instances of the effect. That separate processing of channels may lead to unexpected results with some effect types.

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

Platform-specific

DX8 effects are a Windows feature requiring DirectX 8, or DirectX 9 for floating-point support. On other platforms, they are emulated by BASS, except for the following which are currently unsupported: COMPRESSOR, GARGLE, and I3DL2REVERB.

See also

BASS_ChannelLock, BASS_ChannelRemoveFX, BASS_FXGetParameters, BASS_FXReset, BASS_FXSetParameters, BASS_FXSetPriority, BASS_ChannelSetDSP, BASS_CONFIG_FLOATDSP