BASS.NET API for the Un4seen BASS Audio Library

BassWaDspBASS_WADSP_ChannelSetDSP Method

BASS.NET API for the Un4seen BASS Audio Library
Assigns a loaded Winamp DSP to a standard BASS channel as a new DSP.

This method is pretty close to the BASS_ChannelSetDSP(Int32, DSPPROC, IntPtr, Int32) method (which is in fact internally used) but instead of setting up a user DSP method the Winamp DSP will be set up.

Namespace:  Un4seen.Bass.AddOn.WaDsp
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

[DllImportAttribute("bass_wadsp")]
public static int BASS_WADSP_ChannelSetDSP(
	int plugin,
	int handle,
	int priority
)

Parameters

plugin
Type: SystemInt32
The plugin handle (returned by BASS_WADSP_Load(String, Int32, Int32, Int32, Int32, WINAMPWINPROC)).
handle
Type: SystemInt32
The BASS channel handle (HSTREAM, HMUSIC, or HRECORD) which to assign to the Winamp DSP.
priority
Type: SystemInt32
The priority of the new DSP, which determines it's position in the Bass DSP chain - DSPs with higher priority are called before those with lower.

Return Value

Type: Int32
If succesful, then the new DSP's handle (HDSP) is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

This method can and should only be used with those Winamp DSPs which return exactly as much samples as provided - meaning not modifying the samplerate, tempo, pitch etc.!

The Winamp DSP and this method can be used with 8-bit, 16-bit or float channels. Since all Winamp DSPs will internally only work with 16-bit channels an automatic internal conversion from 8-bit resp. float to 16-bit and back will take place.

ERROR CODEDescription
BASS_ERROR_HANDLEThe plugin or handle is not a valid handle.

Examples

private int _streamA = 0;
private int _dspPluginA = 0;
...
_dspPluginA = BassWaDsp.BASS_WADSP_Load("dsp_test.dll", 5, 5, 100, 100, null);
BassWaDsp.BASS_WADSP_Start(_dspPluginA, 0, 0);
...
// create the stream
_streamA = Bass.BASS_StreamCreateFile("test.mp3", 0, 0, 
                BASSFlag.BASS_DEFAULT | BASSFlag.BASS_STREAM_AUTOFREE);
// play the stream
if (_streamA != 0 )
{
    // the next will setup a DSP on the playing channel to the selected Winamp DSP
    int hDsp = BassWaDsp.BASS_WADSP_ChannelSetDSP(this._dspPluginA, _streamA, 1);
    // and finally play it
    Bass.BASS_ChannelPlay(_streamA, false);
}
See Also

Reference