BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_GetDeviceInfo Method (Int32, BASS_DEVICEINFO)BASS.NET API for the Un4seen BASS Audio Library
Retrieves information on an output device.

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

public static bool BASS_GetDeviceInfo(
	int device,
	BASS_DEVICEINFO info
)

Parameters

device
Type: SystemInt32
The device to get the information of... 0 = first.
info
Type: Un4seen.BassBASS_DEVICEINFO
An instance of the BASS_DEVICEINFO class to store the information at.

Return Value

Type: Boolean
If successful, then is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

This function can be used to enumerate the available devices for a setup dialog. Device 0 is always the "no sound" device, so if you should start at device 1 if you only want to list real devices.

ERROR CODEDescription
BASS_ERROR_DEVICEThe device number specified is invalid.

Platform-specific

On Linux, a "Default" device is hardcoded to device number 1, which uses the default output set in the ALSA config, and the real devices start at number 2. That is also the case on Windows when the BASS_CONFIG_DEV_DEFAULT option is enabled.

On OSX, the BASS_DEVICES_AIRPLAY flag can be used in the device paramater to enumerate Airplay receivers instead of soundcards. A shared buffer is used for the Airplay receiver name information, which gets overwritten each time Airplay receiver information is requested, so it should be copied if needed. The BASS_CONFIG_AIRPLAY config option can be used to change which of the receiver(s) are used.

Examples

List all available devices:
VB
Dim n As Integer = 0
Dim info As New BASS_DEVICEINFO()
While (Bass.BASS_GetDeviceInfo(n, info))
  Console.WriteLine(info.ToString())
  n += 1
End While
BASS_DEVICEINFO info = new BASS_DEVICEINFO();
for (int n=0; Bass.BASS_GetDeviceInfo(n, info); n++)
{
  Console.WriteLine(info.ToString());
}
Or use the BASS_GetDeviceInfos method for more convenience.
See Also

Reference