BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_RecordGetDeviceInfo Method (Int32)BASS.NET API for the Un4seen BASS Audio Library
Retrieves information on a recording device.

Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

public static BASS_DEVICEINFO BASS_RecordGetDeviceInfo(
	int device
)

Parameters

device
Type: SystemInt32
The device to get the information of... 0 = first.

Return Value

Type: BASS_DEVICEINFO
If successful, then an instance of the BASS_DEVICEINFO class is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

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

ERROR CODEDescription
BASS_ERROR_DEVICEThe device number specified is invalid.
BASS_ERROR_DXA sufficient version of DirectX is not installed.

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.

Examples

Find the system default recording device:
VB
Dim defDevice As Integer = -1
Dim n As Integer = 0
Dim info As New BASS_DEVICEINFO()
While Not (info Is Nothing)
  info = Bass.BASS_RecordGetDeviceDescription(n)
  If Not (info Is Nothing) And info.IsDefault Then
    defDevice = n
    Exit While
  End If
  n += 1
End While
int defDevice = -1;
BASS_DEVICEINFO info;
for (int n = 0; (info = Bass.BASS_RecordGetDeviceInfo(n)) != null; n++)
{
  if (info.IsDefault)
  {
    defDevice = n;
    break;
  }
}
Or use the BASS_RecordGetDeviceInfos method for more convenience.
See Also

Reference