BASS_RecordGetInput
Retrieves the current settings of a recording input source.
DWORD BASS_RecordGetInput( int input, float *volume );
Parameters
input | The input to get the settings of... 0 = first, -1 = master. |
volume | Pointer to a variable to receive the volume... NULL = don't retrieve the volume. |
Return value
If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code. If successful, then the settings are returned. The BASS_INPUT_OFF flag will be set if the input is disabled, otherwise the input is enabled. The type of input is also indicated in the high 8 bits (use BASS_INPUT_TYPE_MASK to test) of the return value, and can be one of the following. If the volume is requested but not available, volume will receive -1.BASS_INPUT_TYPE_DIGITAL | Digital input source, for example, a DAT or audio CD. |
BASS_INPUT_TYPE_LINE | Line-in. On some devices, "Line-in" may be combined with other analog sources into a single BASS_INPUT_TYPE_ANALOG input. |
BASS_INPUT_TYPE_MIC | Microphone. |
BASS_INPUT_TYPE_SYNTH | Internal MIDI synthesizer. |
BASS_INPUT_TYPE_CD | Analog audio CD. |
BASS_INPUT_TYPE_PHONE | Telephone. |
BASS_INPUT_TYPE_SPEAKER | PC speaker. |
BASS_INPUT_TYPE_WAVE | The device's WAVE/PCM output. |
BASS_INPUT_TYPE_AUX | Auxiliary. Like "Line-in", "Aux" may be combined with other analog sources into a single BASS_INPUT_TYPE_ANALOG input on some devices. |
BASS_INPUT_TYPE_ANALOG | Analog, typically a mix of all analog sources. |
BASS_INPUT_TYPE_UNDEF | Anything that is not covered by the other types. |
Error codes
BASS_ERROR_INIT | BASS_RecordInit has not been successfully called. |
BASS_ERROR_ILLPARAM | input is invalid. |
BASS_ERROR_NOTAVAIL | A master input is not available. |
BASS_ERROR_UNKNOWN | Some 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).
Example
List all available input sources, with their current status.int n; char *name; for (n=0; name=BASS_RecordGetInputName(n); n++) { float vol; int s=BASS_RecordGetInput(n, &vol;); printf("%s [%s : %g]\n", name, s&BASS;_INPUT_OFF?"off":"on", vol); }
Find a microphone input.
int mic=-1, n, flags; for (n=0; (flags=BASS_RecordGetInput(n, NULL))!=-1; n++) { if ((flags&BASS;_INPUT_TYPE_MASK)==BASS_INPUT_TYPE_MIC) { // found the mic! mic=n; break; } } if (mic!=-1) printf("Found a microphone at input %d\n", mic); else printf("No microphone found\n");