This project has moved and is read-only. For the latest updates, please go here.

WaveIn.StopRecording hangs in Release mode, works fine in Debug mode

Jul 24, 2014 at 12:01 AM
Edited Jul 24, 2014 at 12:02 AM
I'm recording audio from my logitech webcam without any problems, but when I call WaveIn.StopRecording it hangs on
MmException.Try(WaveInterop.waveInStop(waveInHandle), "waveInStop");
In Debug mode this works fine and I can step on through the rest of the code.
the StopRecording call is made using the Dispatcher :
Dispatcher.Invoke(new Action(() => EnableAudioRecording(false)));
(Where EnableAudioRecording calls WaveIn.StopRecording)

Silly thing is that the NAudio Demo works just fine starting and stopping recording, also in release mode.
Am I missing something ? Are there any stupid things I shouldn't do that could cause this behaviour ?
Jul 28, 2014 at 5:29 PM
Check that no calls to waveIn methods happen on different threads. Some audio drivers can have issues with this.
You could also try WaveInEvent as an alternative if WaveIn isn;t working for you,.