title: Detect if headphones are plugged in or not via C#
body: <p>There is no example how to detect if headphones are plugged in or not via C#.</p>
  
  <p>I assume should be some event for that...</p>
  
  <p>Does make sense to use WMI?</p>
  
  <pre><code> ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\cimv2",
                                                                    "SELECT * FROM Win32_SoundDevice");
  
  foreach (ManagementObject queryObj in searcher.Get())
  {
      Console.WriteLine("-----------------------------------");
      Console.WriteLine("Win32_SoundDevice instance");
      Console.WriteLine("-----------------------------------");
      Console.WriteLine("StatusInfo: {0}", queryObj["StatusInfo"]);
  }
  </code></pre>
  
  <p>Would anyone be so pleased to provide it?</p>
  
  <p>Thank you!</p>