BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_RecordGetInputType Method BASS.NET API for the Un4seen BASS Audio Library
Retrieves the type of input of a recording input source.

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

public static BASSInputType BASS_RecordGetInputType(
	int input
)

Parameters

input
Type: SystemInt32
The input to get the settings of... 0 = first, -1 = master.

Return Value

Type: BASSInputType
One of the BASSInputType values (BASS_INPUT_TYPE_ERROR on error).
Remarks

BASS_RecordGetInput(Int32, Single) returns both, the BASSInputType (in the high-word) as well as the BASSInput (in the low-word). Use this overload to only retrieve the BASSInput without the BASSInputType.

ERROR CODEDescription
BASS_ERROR_INITBASS_RecordInit(Int32) has not been successfully called - there are no initialized.
BASS_ERROR_ILLPARAMinput is invalid.
BASS_ERROR_UNKNOWNSome other mystery problem!

Platform-specific

The input type information is only available on Windows. There is no "what you hear" type of input defined; if the device has one, it will typically come under BASS_INPUT_TYPE_ANALOG or BASS_INPUT_TYPE_UNDEF.

On OSX, there is no master input (-1), and only the currently enabled input has its volume setting available (if it has a volume control).

Examples

Find a microphone input:
VB
Bass.BASS_RecordInit(- 1)
Dim mic As Integer = -1
Dim n As Integer = 0
Dim flags As BASSInputType = BASSInputType.BASS_INPUT_TYPE_UNDEF
While flags <> BASSInputType.BASS_INPUT_TYPE_ERROR
  ' get the settings of that input
  flags = Bass.BASS_RecordGetInputType(n)
  If (flags And BASSInputType.BASS_INPUT_TYPE_MASK) = BASSInputType.BASS_INPUT_TYPE_MIC) Then
    ' found the mic!
    mic = n
    Exit While
  End If
  n += 1
End While
If mic <> -1 Then
  Console.WriteLine("Found a MIC at input {0}", mic)
Else
  Console.WriteLine("No MIC found!")
End If
Bass.BASS_RecordInit(-1); // init the default device
int mic = -1;
BASSInputType flags;
for (int n=0; (flags=Bass.BASS_RecordGetInputType(n)) != BASSInputType.BASS_INPUT_TYPE_ERROR; n++)
{
  if ( (flags & BASSInputType.BASS_INPUT_TYPE_MASK) == BASSInputType.BASS_INPUT_TYPE_MIC )
  { 
    // found the mic!
    mic = n;
    break;
  }
}
if (mic != -1)
  Console.WriteLine( "Found a MIC at input {0}", mic );
else
  Console.WriteLine( "No MIC found!" );
See Also

Reference