Checks if a particular sample format is supported by a device (endpoint).
Namespace: Un4seen.BassWasapi
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
[DllImportAttribute("basswasapi")] public static BASSWASAPIFormat BASS_WASAPI_CheckFormat( int device, int freq, int chans, BASSWASAPIInit flags )
Parameters
- device
- Type: SystemInt32
The device to use... 0 = first device, -1 = default device, -2 = default input device. BASS_WASAPI_GetDeviceInfo(Int32, BASS_WASAPI_DEVICEINFO) can be used to enumerate the available devices. - freq
- Type: SystemInt32
The sample rate to check. - chans
- Type: SystemInt32
The number of channels to check... 1 = mono, 2 = stereo, etc. - flags
- Type: Un4seen.BassWasapiBASSWASAPIInit
Any combination of these flags (see BASSWASAPIInit):BASS_WASAPI_SHARED Check the device in shared mode. BASS_WASAPI_EXCLUSIVE Check the device in exclusive mode. The HIWORD - use Utils.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
Type: BASSWASAPIFormatIf the sample format is supported, the maximum supported resolution (a BASSWASAPIFormat value) is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
Shared and exclusive modes may have different sample formats available. Only the "mix format" (available from BASS_WASAPI_GetDeviceInfo(Int32, BASS_WASAPI_DEVICEINFO)) is generally supported in shared mode.
ERROR CODE | Description |
---|---|
BASS_ERROR_WASAPI | WASAPI is not available. |
BASS_ERROR_DEVICE | The device number specified is invalid. |
BASS_ERROR_DRIVER | The driver could not be initialized. |
BASS_ERROR_FORMAT | Unsupported sample format or number of channels. |
See Also