Adds sample data to a "push" stream.
DWORD BASS_StreamPutData( HSTREAM handle, void *buffer, DWORD length );
handle | The stream handle. |
buffer | Pointer to the sample data... NULL = allocate space in the queue buffer so that there is at least length bytes of free space. |
length | The amount of data in bytes, optionally using the BASS_STREAMPROC_END flag to signify the end of the stream. 0 can be used to just check how much data is queued. |
BASS_ERROR_HANDLE | handle is not valid. |
BASS_ERROR_NOTAVAIL | The stream is not using the push system. |
BASS_ERROR_ILLPARAM | length is not valid, it must equate to a whole number of samples. |
BASS_ERROR_ENDED | The stream has ended. |
BASS_ERROR_MEM | There is insufficient memory or the BASS_ATTRIB_PUSH_LIMIT limit is exceeded. |
DSP/FX are applied when the data reaches the playback buffer, or the BASS_ChannelGetData call in the case of a decoding channel.
Data should be provided at a rate sufficent to sustain playback. If the buffer gets exhausted, BASS will automatically stall playback of the stream, until more data is provided. BASS_ChannelGetData (BASS_DATA_AVAILABLE) can be used to check the playback buffer level, and BASS_ChannelIsActive can be used to check if playback has stalled. A BASS_SYNC_STALL sync can also be set via BASS_ChannelSetSync, to be triggered upon playback stalling or resuming.