From 1b90f403f21c87cba8d75e5f7979551838db341c Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Wed, 10 Dec 2025 16:06:19 -0500 Subject: [PATCH] try catch around initial audio input startup due to a failure of the underlying WinMM; --- dvmconsole/MainWindow.xaml.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dvmconsole/MainWindow.xaml.cs b/dvmconsole/MainWindow.xaml.cs index 93885b8..bcc061f 100644 --- a/dvmconsole/MainWindow.xaml.cs +++ b/dvmconsole/MainWindow.xaml.cs @@ -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; - waveIn.StartRecording(); + 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);