1

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.

Vib
  • 220
  • 1
  • 2
  • 7

2 Answers2

1

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.

Mungoid
  • 1,229
  • 1
  • 9
  • 22
  • 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? – Vib Jun 18 '12 at 14:16
1

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.

Laurent Couvidou
  • 9,171
  • 2
  • 41
  • 57