2

I have several web cameras being attached to my PC. Each camera has a built-in microphone. I use the DirectShow.NET library to enumerate audio and video sources:

var audioDevices = DsDevice.GetDevicesOfCat(FilterCategory.AudioInputDevice).Convert<DsDevice>();
var videoDevices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice).Convert<DsDevice>();

Thus I get two arrays. Now I need to play simultaneously audio and video from one specific camera. Let's say I use index or DevicePath property to select a required video source. How can I get the audio device which is related to the selected video source?

paft
  • 121
  • 2
  • 8

1 Answers1

0

There is no [standard] way to identify that specific video and audio devices are related. Sometimes, you can parse device moniker display name and detect that matching fragments, helpful enough to identify devices of your interest.

A helpful related post on MSDN Forums: How to identify a video device correctly?; see also: uniquiely differentiate between multiple cameras [dshow, directx, win32api]

Community
  • 1
  • 1
Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Thanks, Roman, for your answer. I've come to the same conclusion. Parsing moniker display names doesn't help with all my USB cameras. So I think it's easier just to select manually the needed video and audio sources. – paft Apr 28 '14 at 10:56