From 0ac141684c1cb731cf313823b9778cd04bcaa08b Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sat, 28 Apr 2012 19:14:37 +0200 Subject: [PATCH] fixed crash if there are no mics --- Vocaluxe/Lib/Sound/CPortAudioRecord.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Vocaluxe/Lib/Sound/CPortAudioRecord.cs b/Vocaluxe/Lib/Sound/CPortAudioRecord.cs index 87bff1ab..a55a28d0 100644 --- a/Vocaluxe/Lib/Sound/CPortAudioRecord.cs +++ b/Vocaluxe/Lib/Sound/CPortAudioRecord.cs @@ -103,6 +103,15 @@ namespace Vocaluxe.Lib.Sound if (!_initialized) return false; + if (DeviceConfig == null) + return false; + + if (_recHandle == null) + return false; + + if (_recHandle.Length == 0) + return false; + for (int i = 0; i < _Buffer.Length; i++) { _Buffer[i].Reset();