diff --git a/Vocaluxe/Lib/Sound/CPortAudioRecord.cs b/Vocaluxe/Lib/Sound/CPortAudioRecord.cs index dd4a631b..2df903f7 100644 --- a/Vocaluxe/Lib/Sound/CPortAudioRecord.cs +++ b/Vocaluxe/Lib/Sound/CPortAudioRecord.cs @@ -119,6 +119,16 @@ namespace Vocaluxe.Lib.Sound _Buffer[i].Reset(); } + for (int i = 0; i < _recHandle.Length; i++) + { + int waitcount = 0; + while (waitcount < 5 && PortAudio.Pa_IsStreamStopped(_recHandle[i]) == PortAudio.PaError.paStreamIsNotStopped) + { + System.Threading.Thread.Sleep(1); + waitcount++; + } + } + for (int i = 0; i < _recHandle.Length; i++) { _recHandle[i] = IntPtr.Zero;