Selecting Audio Device

Hi all,
I am using SDL-1.2 library on Windows platform and my PC is connected with
multiple speakers (Audio Output Device). When I play audio it always select
the default one. I do not see any API to select a speaker of my choice. With
the function SDL_OpenAudioDevice() we can select a device but this API is
not supported in SDL-1.3. The current version SDL-1.2 only supports
SDL_OpenAudio() which does not allow to open a selected device.

How can I select a specific audio device in SDL-1.2 ?
Any help is appreciated.

Thanks,
Aveek

Hi all,
I am using SDL-1.2 library on Windows platform and my PC is connected with
multiple speakers (Audio Output Device). When I play audio it always select
the default one. I do not see any API to select a speaker of my choice. With
the function SDL_OpenAudioDevice() we can select a device but this API is
not supported in SDL-1.3. The current version SDL-1.2 only supports
SDL_OpenAudio() which does not allow to open a selected device.

How can I select a specific audio device in SDL-1.2 ?
Any help is appreciated.

Thanks,
Aveek

Sorry … there was some typo in my previous mail.

I am using SDL-1.2 library on Windows platform and my PC is connected with
multiple speakers (Audio Output Device). When I play audio it always select
the default one. I do not see any API to select a speaker of my choice. With
the function SDL_OpenAudioDevice() we can select a device but this API
is only supported in SDL-1.3. The current version SDL-1.2 only supports
SDL_OpenAudio() which does not allow to open a selected device.

How can I select a specific audio device in SDL-1.2 ?
Any help is appreciated.

Thanks,
Aveek

How can I select a specific audio device in SDL-1.2 ?

You can’t, unfortunately.

(Worse news: SDL 1.3 allows this, but the code isn’t hooked up for
Windows at the moment. This is trivial, though, so I’ll hook that up soon.)

We could theoretically add an environment variable on Windows to do this
with the DirectSound target in SDL 1.2, but the code doesn’t exist at
the moment.

–ryan.

(Worse news: SDL 1.3 allows this, but the code isn’t hooked up for
Windows at the moment. This is trivial, though, so I’ll hook that up soon.)

This is sitting in my sandbox repo now:

 http://hg.icculus.org/icculus/SDL-experimental

…I’m traveling at the moment, so I’ll test and push it to the main
repo when I have access to a Windows box next week. It might not even
compile. But if anyone wants to take a shot at it, have fun. :slight_smile:

–ryan.