Итак, у нас есть что-то вроде:
//...
// Get list of available Capture Devices
const ALchar *pDeviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
if (pDeviceList)
{
ALFWprintf("\nAvailable Capture Devices are:-\n");
while (*pDeviceList)
{
ALFWprintf("%s\n", pDeviceList);
pDeviceList += strlen(pDeviceList) + 1;
}
}
// Get the name of the 'default' capture device
szDefaultCaptureDevice = alcGetString(NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
ALFWprintf("\nDefault Capture Device is '%s'\n\n", szDefaultCaptureDevice);
alGenSources(1, &source);
alGenBuffers(3, buffers);
/* Setup some initial silent data to play out of the source */
alBufferData(buffers[0], AL_FORMAT_MONO16, data, sizeof(data), 22050);
alBufferData(buffers[1], AL_FORMAT_MONO16, data, sizeof(data), 22050);
alBufferData(buffers[2], AL_FORMAT_MONO16, data, sizeof(data), 22050);
alSourceQueueBuffers(source, 3, buffers);
/* If you don't need 3D spatialization, this should help processing time */
alDistanceModel(AL_NONE);
// Open the default Capture device to record a 22050Hz 16bit Mono Stream using an internal buffer
// of BUFFERSIZE Samples (== BUFFERSIZE * 2 bytes)
pCaptureDevice = alcCaptureOpenDevice(szDefaultCaptureDevice, 22050, AL_FORMAT_MONO16, BUFFERSIZE);
if (pCaptureDevice)
{//...
, но здесь мы используем только устройство по умолчанию.Как позволить пользователю выбрать один и чем его использовать?