Retrieves the immediate sample data of a playing stream, or MOD music channel.
DWORD WINAPI BASS_ChannelGetData( |
Parameters
handle | The channel handle... a HMUSIC, HSTREAM. |
buffer | Location to write the sample data. |
length | Number 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_HANDLE | handle is not a valid channel. |
BASS_ERROR_NOPLAY | The channel is not playing. |
BASS_ERROR_BUFLOST | Should 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