Invokes the internal 'ModifySamples' method of the Winamp DSP directly (which is only needed for user defined DSPPROC callbacks).
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_ModifySamplesDSP( int plugin, IntPtr buffer, int length )
Parameters
- plugin
- Type: SystemInt32
The plugin handle (returned by BASS_WADSP_Load(String, Int32, Int32, Int32, Int32, WINAMPWINPROC)). - buffer
- Type: SystemIntPtr
The IntPtr to the memory block containing the sample data to modify. - length
- Type: SystemInt32
The number of bytes contained in the buffer.
Return Value
Type: Int32The number of bytes modified, which should always be the number of bytes specified when calling this method. Or 0, if an error occured.
Remarks
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.
Examples
private int _streamA = 0; private int _dspPluginA = 0; private DSPPROC _myDSPAddr; ... _dspPluginA = BassWaDsp.BASS_WADSP_Load("dsp_test.dll", 5, 5, 100, 100, null); BassWaDsp.BASS_WADSP_Start(_dspPluginA, 0, 0); ... _streamA = Bass.BASS_StreamCreateFile("test.mp3", 0, 0, BASSFlag.BASS_DEFAULT | BASSFlag.BASS_STREAM_AUTOFREE); // play the stream if (_streamA != 0 ) { _myDSPAddr = new DSPPROC(MyWinampDSP); Bass.BASS_ChannelSetDSP(_streamA, _myDSPAddr, new IntPtr(_dspPluginA), -500); BassWaDsp.BASS_WADSP_SetChannel(_dspPluginA, _streamA); Bass.BASS_ChannelPlay(_streamA, false); } ... private void MyWinampDSP(int handle, int channel, IntPtr buffer, int length, IntPtr user) { if (length == 0 || buffer == IntPtr.Zero) return; BassWaDsp.BASS_WADSP_ModifySamplesDSP(user.ToInt32(), buffer, length); }
See Also