From a5ef5f0d0e1b2098318076ced47de4e7ccbe0e50 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Sat, 21 Feb 2015 01:38:05 +0300 Subject: [PATCH] Fixed some bugs 1 fixed bug with "Unsupported Wave Format" (https://github.com/jtarrio/SoftwareModem/issues/1) 2 fixed missing check on data sending --- SoftwareModem/MainWindow.xaml.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SoftwareModem/MainWindow.xaml.cs b/SoftwareModem/MainWindow.xaml.cs index 6bae4c7..7a6b758 100644 --- a/SoftwareModem/MainWindow.xaml.cs +++ b/SoftwareModem/MainWindow.xaml.cs @@ -107,12 +107,14 @@ private WasapiCapture GetCaptureDevice() var device = lineInBox.SelectedItem as MMDevice; var capture = new NAudio.CoreAudioApi.WasapiCapture(device); capture.ShareMode = AudioClientShareMode.Shared; - capture.WaveFormat = new WaveFormat(); return capture; } private void SendButton_Click(object sender, RoutedEventArgs e) { + if (modem==null) { + MessageBox.Show("Connection is not set up", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + } var bytes = new byte[InputBox.Text.Length]; for (int i = 0; i < InputBox.Text.Length; ++i) {