BASS WAS API

BASS_WASAPI_PutData


Adds sample data to an output device buffer.

DWORD BASS_WASAPI_PutData(
    void *buffer,
    DWORD length
);

Parameters

bufferPointer to the sample data.
lengthThe amount of data in bytes.

Return value

If successful, the amount of data used is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_INITBASS_WASAPI_Init has not been successfully called.
BASS_ERROR_NOTAVAILThe device is being fed by a WASAPIPROC callback function, or it is an input device.
BASS_ERROR_ILLPARAMlength is not valid, it must equate to a whole number of samples.
BASS_ERROR_UNKNOWNSome other mystery problem!

Remarks

As much data as possible will be placed in the device's buffer; this function will have to be called again for any remainder.

Data should be provided at a rate sufficent to sustain playback. If the buffer gets exhausted, output will stall until more data is provided. BASS_WASAPI_GetData (BASS_DATA_AVAILABLE) can be used to check how much data is buffered.

See also

BASS_WASAPI_Init, WASAPIPROC callback