BASS_WASAPI_CheckFormat
Checks if a particular sample format is supported by a device.
DWORD BASS_WASAPI_CheckFormat(
int device,
DWORD freq,
DWORD chans,
DWORD flags
);
Parameters
device | The device to use... -1 = default output device, -2 = default input device, -3 = default loopback input device. BASS_WASAPI_GetDeviceInfo can be used to enumerate the available devices.
|
freq | The sample rate.
|
chans | The number of channels... 1 = mono, 2 = stereo, etc.
|
flags | Any combination of these flags.
BASS_WASAPI_EXCLUSIVE | Check the device in exclusive mode, else shared mode. The HIWORD - use MAKELONG(flags,format) - can be used to limit the sample formats that are checked in exclusive mode. The default is to check 32-bit floating-point, 32-bit integer, 24-bit integer, 16-bit integer, 8-bit integer, in that order. A BASS_WASAPI_FORMAT value (see BASS_WASAPI_INFO) can be used to bypass the formats that precede it in that list.
|
|
Return value
If the sample format is supported, the maximum supported resolution (a BASS_WASAPI_FORMAT value) is returned, else -1 is returned. Use
BASS_ErrorGetCode to get the error code.
Error codes
BASS_ERROR_WASAPI | WASAPI is not available.
|
BASS_ERROR_DEVICE | device is invalid.
|
BASS_ERROR_NOTAVAIL | Exclusive mode is unavailable on loopback devices.
|
BASS_ERROR_DRIVER | The driver could not be initialized.
|
BASS_ERROR_FORMAT | The specified format is not supported by the device.
|
Remarks
Shared and exclusive modes may have different sample formats available. Only the "mix format" (available from
BASS_WASAPI_GetDeviceInfo) is generally supported in shared mode.
See also
BASS_WASAPI_Init