BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_ChannelGetDevice Method BASS.NET API for the Un4seen BASS Audio Library
Retrieves the device that the channel is using.

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

public static int BASS_ChannelGetDevice(
	int handle


Type: SystemInt32
The channel handle... a HCHANNEL, HMUSIC, HSTREAM, or HRECORD. HSAMPLE handles may also be used.

Return Value

Type: Int32
If successful, the device number is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.

Recording devices are indicated by the HIWORD of the return value being 1, when this function is called with a HRECORD channel.

The return value may be BASS_NODEVICE (0x20000), if the channel is not associated with a device.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not a valid channel.


Check, if a device number is a recording device:
Dim isRecordingDevice As Boolean = False
Dim device As Integer = Bass.BASS_ChannelGetDevice(stream)
If device <> - 1 AndAlso Utils.HighWord(device) = 1 Then
  isRecordingDevice = True
End If
bool isRecordingDevice = false;
int device = Bass.BASS_ChannelGetDevice(stream);
if (device != -1 && Utils.HighWord(device) == 1)
  isRecordingDevice = true;
See Also