1
\$\begingroup\$

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.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

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.

\$\endgroup\$
1
\$\begingroup\$

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.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ 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? \$\endgroup\$ Jun 18, 2012 at 14:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .