Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

2 Answers 2

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
1  
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

 
discard

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.