BASS_RecordGetDeviceInfo

Retrieves information on a recording device.

BOOL BASS_RecordGetDeviceInfo(
    DWORD device,
    BASS_DEVICEINFO *info
);

Parameters

deviceThe device to get the information of... 0 = first.
infoPointer to a structure to receive the information.

Return value

If successful, then TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_DXA sufficient version of DirectX is not installed.
BASS_ERROR_DEVICEdevice is invalid.

Remarks

This function can be used to enumerate the available devices for a setup dialog.

Platform-specific

Recording support requires DirectX 5 (or above) on Windows.

On Linux, a "Default" device is hardcoded to device number 0, which uses the default input set in the ALSA config.

Example

Get the total number of devices currently present.
int a, count = 0;
BASS_DEVICEINFO info;
for (a = 0; BASS_RecordGetDeviceInfo(a, &info); a++)
    if (info.flags & BASS_DEVICE_ENABLED) // device is enabled
        count++; // count it

Find a microphone.

int a;
BASS_DEVICEINFO info;
for (a = 0; BASS_RecordGetDeviceInfo(a, &info); a++)
    if ((info.flags & BASS_DEVICE_ENABLED) && (info.flags & BASS_DEVICE_TYPE_MASK) == BASS_DEVICE_TYPE_MICROPHONE) { // found an enabled microphone
        // do something
    }

See also

BASS_RecordGetInfo, BASS_RecordInit, BASS_DEVICEINFO structure