Retrieves the current settings of a recording input source.
DWORD BASS_RecordGetInput(
int input,
float *volume
);
| 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. |
| 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. |
| 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! |
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).
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");