title: Detecting when a microphone is unplugged
body: <p>I have a Windows Forms application and in this I have a <kbd>Start</kbd> and a <kbd>Stop</kbd> button. When I click the <kbd>Start</kbd> button a recording should start and when I click the <kbd>Stop</kbd> button the recording should stop. It's working fine, but my requirement is when I started recording, if I unplug the microphone the recording should stop. However, my current code does not do this. Here is my current code:</p>
  
  <pre><code>uint hr = MFRecWrapper.StartRecording(microPhoneName.Trim(), this.fileName.Trim(), this.bitSamplingBitrate, this.avgBytesWrittenPerSecond, this.Handle);
  uint hr = MFRecWrapper.StopRecording();
  </code></pre>
  
  <p>How can I make it so that it achieves that effect? Thanks.</p>