Is it possible to directly select a recorder in OpenAL?

I had never worked with OpenAL before and looked at sample code. However, before I start testing the code in my program, I want to know if there is a way to choose a specific recording device for input (perhaps using a combined unit with different microphones). I know this is not possible in the Java Sound API, so I'm asking about AL.

+4
source share
1 answer

Yes.

Get a list of devices. Ask the user to select it. Install it using alcCaptureOpenDevice .

See API ALC11 .

Sort of:

 String[] capDevices = ALC11.alcGetString(null, ALC11.ALC_CAPTURE_DEVICE_SPECIFIER).split("\0"); for (int i = 0; i < capDevices.length; i++) { System.out.println("Capture device "+ i + ": " + capDevices[i]); } //Selection code goes here String chosenDevice = ...; ALCdevice device = ALC11.alcCaptureOpenDevice(chosenDevice, freq, format, bufferSize); 

(Disclaimer: not compiled / tested)

+1
source

All Articles