As the title says I'd like to check if my microphone is muted. Or even better get an event if it gets muted/unmuted.
I tried to get some information form the internet. Turns out I simply don't get it. I found out about the "new" Audio Core API which gave me some ideas, sadly I did not find any c#
code so I cant figure out how to use any of this.
With the following code I could get some information for my microphone, however nothing changes if I mute it.
ManagementObjectSearcher objSearcher = new ManagementObjectSearcher(
"SELECT * FROM Win32_SoundDevice");
ManagementObjectCollection objCollection = objSearcher.Get();
ManagementObject rodeMic = null;
foreach (ManagementObject obj in objCollection)
{
foreach (PropertyData property in obj.Properties)
{
if (property.Name == "DeviceID" && (string) property.Value == "USB\\VID_...")
{
rodeMic = obj;
}
}
}
if (rodeMic != null)
{
foreach (var property in rodeMic.Properties)
{
Console.Out.WriteLine(String.Format("{0}:{1}", property.Name, property.Value));
}
}