Discussion:
Switching between Input-devices using OpenAL
Akihito KAWASAKI
2013-06-24 08:37:08 UTC
Permalink
In my software, I have used Microsoft CoreAudioAPIs to switch between
Line/Mic-In and Stereo Mixer with Sound Blaster Audigy Value(SB-AGY-VL).

But I've got a problem when using USB Sound Devices.
It is not possible to switch between Line/Mic-In and Stereo Mixer
with the recent Sound Devices using CoreAudioAPIs.
(It's possible to switch between them with SB Audigy Value and Old-SoundMax etc.)

I want to use products as below.
SoundBlaster X-Fi Surround5.1
SoundBlaster X-Fi Go!

Is there some way switching between sound device properties using OpenAL?

Any information, however small, would be appreciated.

Programming language: C++
OperationSystem: Windows 7

Excuse me for my poor English.

Respectfully yours,
keghn
2013-06-28 18:34:16 UTC
Permalink
Hello,
Dose openAL detect everything, even the usb microphone?



/*
Compile with:

g++ openal_detect.cpp -lalut -lopenal -o openal_detect

This program detects sound devices that openal can use.
*/

#include <AL/al.h> // OpenAL header files
#include <AL/alc.h>
#include <cstring>
#include <iostream>


/*
//for windows ?
#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <windows.h>
#include <al.h>
#include <alc.h>
*/

using namespace std;
int main()
{
const ALCchar *szDefaultCaptureDevice;

ALCdevice *pCaptureDevice[2];
ALCcontext *ctx;

pCaptureDevice[0] = alcOpenDevice(NULL);
ctx = alcCreateContext(pCaptureDevice[0], NULL);
alcMakeContextCurrent(ctx);

alGetError();

// Get list of available Capture Devices
const ALchar *pDeviceList = alcGetString(NULL,
ALC_CAPTURE_DEVICE_SPECIFIER);
if (pDeviceList)
{///

cout<<"\n Available Capture Devices are:\n";

while (*pDeviceList)
{
cout<<"\n"<< pDeviceList;
pDeviceList += strlen(pDeviceList) + 1;
}
}///

szDefaultCaptureDevice =
alcGetString(NULL,ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
cout<<"\n\n Default Capture Device is:\n"<<
szDefaultCaptureDevice<<"\n\n";

alcCaptureStop(pCaptureDevice[1]);
alcCaptureCloseDevice(pCaptureDevice[0]);
alcCaptureCloseDevice(pCaptureDevice[1]);
alcCaptureCloseDevice(pCaptureDevice[2]);

alcMakeContextCurrent(NULL);
alcDestroyContext(ctx);
alcCloseDevice(pCaptureDevice[0]);

return 0;

}



--
View this message in context: http://openal.996291.n3.nabble.com/Switching-between-Input-devices-using-OpenAL-tp5517p5523.html
Sent from the OpenAL - User mailing list archive at Nabble.com.

Loading...