BASS.NET API for the Un4seen BASS Audio LibraryBassWaDspBASS_WADSP_Load Method BASS.NET API for the Un4seen BASS Audio Library
Loads a Winamp DSP library.

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

[DllImportAttribute("bass_wadsp.dll", CharSet = CharSet.Auto)]
public static int BASS_WADSP_Load(
	string dspfile,
	int x,
	int y,
	int width,
	int height,
	WINAMPWINPROC proc
)

Parameters

dspfile
Type: SystemString
The fully qualified path and name of the Winamp DSP library you want to load (e.g. "C:\\Program Files\\Winamp\\Plugins\\dsp_ss.dll"). Both Unicode as well as Ansi filenames are supported, whereas Unicode is tried first.
x
Type: SystemInt32
The X-coordinate of the fake Winamp window to create.
y
Type: SystemInt32
The Y-coordinate of the fake Winamp window to create.
width
Type: SystemInt32
The width of the fake Winamp window to create.
height
Type: SystemInt32
The height of the fake Winamp window to create.
proc
Type: Un4seen.Bass.AddOn.WaDspWINAMPWINPROC
An optional WINAMPWINPROC which should be used instead of the internal window process message handler. Or , if you want BASS_WADSP to handle it by default.

Return Value

Type: Int32
The handle of the loaded plugin, which is needed in all further method calls.
Remarks

Most Winamp DSP plugins do save their location and visibility state in an own .ini file. So the parameters specifying the location and size are in most cases only uses for the first time a plugin is used. So don't worry, if they do not take effect.

In most cases the internal Windows message process handler should be fine and sufficient - however, if you encounter problems you might implement your own.

Make sure to call BASS_WADSP_FreeDSP(Int32) when the Winamp DSP is not needed anymore and should be unloaded and removed from memory.

Winamp DSPs are designed to run only for one stream. So if you have multiple streams or multiple players in your application and you want to use the same Winamp DSP you need to create temporary copies of the library files (e.g. copy "dsp_ss.dll" to "dsp_ss2.dll", "dsp_ss3.dll" etc.). Then you should load each individual library copy with this function. This will enable you to load multiple instances of the same Winamp DSP. Each loaded instance can then be used for individual streams.

NOTE: Do not use this method while you have already loaded the same Winamp plugin, as this might result in any unexpected behavior, since some Winamp plugins might crash when they are loaded twice.

ERROR CODEDescription
BASS_ERROR_FILEOPENThe dspfile can not be found or loaded.
BASS_ERROR_FILEFORMThe dspfile doesn't seem to be a Winamp DSP library file.
BASS_ERROR_UNKNOWNSome other problem (the internal fake Winamp window could not be created).

Examples

VB
Dim dspPluginA As Integer = BassWaDsp.BASS_WADSP_Load("dsp_test.dll", 5, 5, 100, 100, Nothing)
If dspPluginA <> 0 Then
  BassWaDsp.BASS_WADSP_Start(dspPluginA, 0, 0)
End If
int dspPluginA = BassWaDsp.BASS_WADSP_Load("dsp_test.dll", 5, 5, 100, 100, null);
if (dspPluginA != 0)
{
  BassWaDsp.BASS_WADSP_Start(dspPluginA, 0, 0);
}
See Also

Reference