try catch around initial audio input startup due to a failure of the underlying WinMM;

pull/12/head
Bryan Biedenkapp 2 months ago
parent 9dfbf7ab3e
commit 1b90f403f2

@ -44,6 +44,7 @@ using MessageBox = System.Windows.MessageBox;
using MouseEventArgs = System.Windows.Input.MouseEventArgs;
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
using System.Net.Sockets;
using NAudio;
namespace dvmconsole
{
@ -172,7 +173,15 @@ namespace dvmconsole
waveIn.DataAvailable += WaveIn_DataAvailable;
waveIn.RecordingStopped += WaveIn_RecordingStopped;
try
{
waveIn.StartRecording();
}
catch (MmException ex)
{
MessageBox.Show($"Error initializing audio input device, {ex.Message}. This *will* cause console inconsistency, and inability to transmit audio.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
Log.StackTrace(ex, false);
}
audioManager = new AudioManager(settingsManager);

Loading…
Cancel
Save

Powered by TurnKey Linux.