2

1. I need list of all device names and types (playback or recording). How can I get them?

2. I also need to determine if device is Playback or Recording device.

By device names I mean names visible here under Playback and Recording tab (screenshot below). Im not familiar with audio under windows, i don't know if these devices are ASIO, DirectSound or something else.

enter image description here

My application should be comaptybile with Windows Vista/7/8, so I decided to use .NET 3.5, but I can use any .NET version supported by Windows Vista/7/8.

Edit: I tried to get these from WMI "SELECT * FROM Win32_SoundDevice", but this is not what I mean. It returns hardware devices, not devices visible in windows sound configuration.

Kamil
  • 13,363
  • 24
  • 88
  • 183

1 Answers1

0

Use How to enumerate audio out devices in c#:

ManagementObjectSearcher objSearcher = new ManagementObjectSearcher(
       "SELECT * FROM Win32_SoundDevice");

ManagementObjectCollection objCollection = objSearcher.Get();

foreach (ManagementObject obj in objCollection)
{
    foreach (PropertyData property in obj.Properties)
    {
        Console.Out.WriteLine(String.Format("{0}:{1}", property.Name, property.Value));
    }
}
Community
  • 1
  • 1
  • This is not what I mean. It returns hardware devices, not these visible in control panel/sound (see screenshot). – Kamil Apr 04 '14 at 08:48