wait until rec streams have stopped (max 5ms) before starting new ones

This commit is contained in:
Alexander Eckart committed 2013-01-06 15:08:30 +01:00
1 parent 57d301018e
commit fdd58d0728
1 file changed
+10
+10
View File
@@ -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;