STREAMPROC callback

User stream writing callback function.

DWORD CALLBACK YourStreamProc{
    HSTREAM handle,
    void *buffer,
    DWORD length
    DWORD user
);

Parameters
handleThe stream that needs writing.
bufferThe buffer to write the sample data in. The sample data must be written in standard Windows PCM format... 8 bit samples are unsigned, 16 bit samples are signed.
lengthThe number of BYTES to write.
userThe user instance data given when BASS_StreamCreate was called.

Return value
The number of bytes written by the function. If this number is less than length, then the stream is assumed to be at the end, and is stopped.

Remarks
A stream writing function should obviously be as quick as possible, other streams (and MOD musics) can't be mixed until it's finished.

Example
A callback function to stream a file, in 44100hz 16 bit stereo.

FILE *file;
...
// the stream writing callback
DWORD CALLBACK MyStreamWriter(HSTREAM handle, void *buf, DWORD len, DWORD user) {
    DWORD c=fread(buf,1,len,file); // read the file into the buffer
    return c; // return the number of bytes written to the buffer
}
...
BASS_StreamCreate(44100,0,&MyStreamWriter,0); // create the stream

See also
BASS_StreamCreate