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: 2.4.12.0
Syntax

[DllImportAttribute("bass.dll", CharSet = CharSet.Unicode)]
public static int BASS_ChannelGetDevice(
	int handle
)

Parameters

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.
Remarks

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

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not a valid channel.

Examples

Check, if a device number is a recording device:
VB
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

Reference