BASS_ChannelGetData

Retrieves the immediate sample data of a playing stream, or MOD music channel.

DWORD WINAPI BASS_ChannelGetData(
    DWORD handle,
    void *buffer,
    DWORD length
);

Parameters
handleThe channel handle... a HMUSIC, HSTREAM.
bufferLocation to write the sample data.
lengthNumber of bytes wanted.

Return value
If an error occurs, 0xFFFFFFFF is returned, use BASS_ErrorGetCode to get the error code. If successful, the number of bytes actually written to the buffer will be returned.

Error codes
BASS_ERROR_HANDLEhandle is not a valid channel.
BASS_ERROR_NOPLAYThe channel is not playing.
BASS_ERROR_BUFLOSTShould not happen, but... PLEASE REPORT IT IF YOU DO GET THIS ERROR!

Remarks
This function can only return as much data as has been written to the channel's buffer, so it'll not always be possible to get the amount of data requested, especially if you request large amounts. If you really do need large amounts, then increase the buffer lengths (BASS_SetBufferLength).

This function is most useful if you wish to visualize (eg. spectrum analyze) the sound.

See also
BASS_ChannelGetLevel, BASS_ChannelIsActive