Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering how I can select the output device for audio in directshow. I am able to get available audio output devices in directshow. But how can I make one of these to be audio output device. Its always going for the default audio device. I want to be able to output audio on my choice of device. I have been struggling through google but couldn't find anything useful. All I could get was this link but it doesn't really solve my problem.

Any help will be really helpful for me.

share|improve this question
up vote 1 down vote accepted

I've not tried it, but a quick MSDN browsing makes me think you could try that:

  1. Enumerate the available devices using an IMMDeviceEnumerator, and let your user pick one. You should have a look at this MSDN page for a head start.

  2. Use the GUID of the selected device for your call to DirectSoundCreate. Reference here.

share|improve this answer

I may be misunderstanding what you are trying to do but I'm guessing you want to do something like change the output device from speakers to headphones or something? I don't believe that you can change the output device via code and I think that is something that can only be changed in the playback devices in the windows sound and volume control.

share|improve this answer
Mungoid, Thanks for reply. Ya I am trying to do something similar, To clarify further, Suppose we have two or more sound cards on system, and I want to be able to play audio on any of those cards by user's choice. I can enumerate through devices available on system, but I am not able to play audio on selected device. how can I do that? – Vibhore Tanwer Jun 18 '12 at 14:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.