Sends sample data to an encoder or all encoders on a channel.
BOOL BASS_Encode_Write(
DWORD handle,
void *buffer,
DWORD length
);
| handle | The encoder or channel handle... a HENCODE, HSTREAM, HMUSIC, or HRECORD. |
| buffer | The buffer containing the sample data. |
| length | The number of bytes in the buffer. |
| BASS_ERROR_HANDLE | handle is not valid. |
| BASS_ERROR_ILLPARAM | length is not valid, it must equate to a whole number of samples. |
| BASS_ERROR_ENDED | No more data may be fed to the encoder. The encoder has died, or its queue is being drained before being freed. |
When a channel handle (rather than encoder handle) is used and there are multiple encoders on the channel, this function will return successfully if any (not necessarily all) of them succeed. This function will also return successfully even if data was dropped due to the encoder's queue being full; BASS_Encode_GetCount can be used to check that there is sufficient space prior to calling this function.