DSPPROC callback

User defined DSP callback function.

void CALLBACK YourDSPProc(
    HDSP handle,
    DWORD channel,
    void *buffer,
    DWORD length,
    DWORD user
);

Parameters
handleThe DSP handle.
channelChannel that the DSP is being applied to.
bufferThe buffer to apply the DSP to. The sample data is in standard Windows PCM format... 8 bit samples are unsigned, 16 bit samples are signed.
lengthThe number of BYTES to process.
userThe user instance data given when BASS_ChannelSetDSP was called.

Remarks
A DSP function should obviously be as quick as possible... streams, MOD musics and other DSP functions can not be processed until it has finished.

Example
A simple DSP callback function to swap the left/right channels of a 16-bit stereo source.

void CALLBACK MyDSPProc(HDSP handle, DWORD channel, void *buffer, DWORD length, DWORD user) {
    short *s=buffer;
    for (;length;length-=4,s+=2) {
        short temp=s[0];
        s[0]=s[1];
        s[1]=temp;
    }
}

See also
BASS_ChannelSetDSP