BASS WAS API

BASS_WASAPI_GetData


Retrieves the immediate sample data or an FFT representation of it.

DWORD BASS_WASAPI_GetData(
    void *buffer,
    DWORD length
);

Parameters

bufferPointer to a buffer to receive the data.
lengthNumber of bytes wanted, and/or the BASS_ChannelGetData flags.

Return value

If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code. When requesting FFT data, the number of bytes read from the device buffer (to perform the FFT) is returned. When requesting sample data, the number of bytes written to buffer will be returned. When using the BASS_DATA_AVAILABLE flag, the number of bytes in the device's buffer is returned.

Error codes

BASS_ERROR_INITBASS_WASAPI_Init has not been successfully called.
BASS_ERROR_NOTAVAILThe BASS_WASAPI_BUFFER flag was not specified in the device's initialization.

Remarks

This function uses BASS_ChannelGetData internally, so it has the same options available.

The BASS_WASAPI_BUFFER flag needs to have been specified in the device's initialization to enable the use of this function, except for with the BASS_DATA_AVAILABLE flag.

With an output device, the BASS_DATA_AVAILABLE return value may be larger than the buffer size indicated by BASS_WASAPI_GetInfo due to additional latency in the device/driver. When a mixer is feeding an output device, the BASS_DATA_AVAILABLE return value can be used with the BASS_ATTRIB_MIXER_LATENCY attribute and/or the BASS_Mixer_ChannelGetPositionEx function, to have the mixer account for the latency in its source position reporting and data/level retrieval.

See also

BASS_WASAPI_GetDeviceLevel, BASS_WASAPI_GetLevel, BASS_WASAPI_GetLevelEx

BASS_ChannelGetData