private void btnParse_Click(object sender, EventArgs e) { txtParsedText.Text = txtAudioResult.Text = string.Empty; if (processor != null) { processor.Dispose(); } if (string.IsNullOrEmpty(txtFilePath.Text)) { MessageBox.Show("Please choose a WAV file", AppConfig.GetConfigValue("APP_MSG_TITLE"), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { processor = new AudioProcessor(AudioSourceMode.AudioFile, txtFilePath.Text); processor.PlayFile = chkPlay.Checked; processor.SpeechRecognized += OnSpeechRecognized; processor.Start(); } catch (Exception ex) { processor = null; MessageBox.Show(ex.Message, AppConfig.GetConfigValue("APP_MSG_TITLE"), MessageBoxButtons.OK, MessageBoxIcon.Error); } }