Updates the playback buffer of a stream or MOD music.
BOOL BASS_ChannelUpdate( DWORD handle, DWORD length );
handle | The channel handle... a HMUSIC or HSTREAM. |
length | The amount of data to render, in milliseconds... 0 = default (2 x BASS_CONFIG_UPDATEPERIOD). This is capped at the space available in the buffer. |
BASS_ERROR_HANDLE | handle is not a valid channel. |
BASS_ERROR_DECODE | handle is a decoding channel, so does not have a playback buffer. |
BASS_ERROR_ENDED | The channel has ended. |
BASS_ERROR_ALREADY | The channel is already being updated. |
When processing granularity has been enabled via the BASS_ATTRIB_GRANULE attribute, the requested amount will be rounded-up (or down if it is too much) to the nearest whole granule.
It may not always be possible to render the requested amount of data, in which case this function will still succeed. BASS_ChannelGetData (BASS_DATA_AVAILABLE) can be used to check how much data is buffered for playback.
When automatic updating is disabled (BASS_CONFIG_UPDATEPERIOD = 0 or BASS_CONFIG_UPDATETHREADS = 0), this function could be used instead of BASS_Update to implement different update periods for different channels, instead of a single update period for all. Unlike BASS_Update, this function can also be used while automatic updating is enabled.
The CPU usage of this function is not included in the BASS_GetCPU reading, but is included in the channel's BASS_ATTRIB_CPU attribute value.