I am working on an windows forms program which listens to all of the active audio input devices using NAudio. The problem I am running into is if an there is only one audio input device is plugged in at the beginning of recording then is removed before the recording ends I received an unhandled MMException with an MMResult of MMResult.NoDriver.
Since I am using the WaveIn.StartRecording() method, which works in another thread I assume, the exception gets thrown up to the main method without being caught.
Does anyone have any suggestions on what I can do to safely continue recording or maybe stop the recording until the device is plugged back in?
There is a solution in the NAudio discussion.
You need to get the source code fix (aka fork) from here and compile it (only x86) for yourself.