private void detectionThresholdTextBox_TextChanged(object sender, global::System.EventArgs e) { int detectionThreshold; global::System.Boolean ok = int.TryParse(detectionThresholdTextBox.Text, out detectionThreshold); if (ok) { if (detectionThreshold > 0) { continuousSpeechRecognitionControl.DetectionThreshold = detectionThreshold; } } }
private void HandleClientProgress(object sender, global::CommunicationLibrary.CommunicationProgressEventArgs e) { if (InvokeRequired) { BeginInvoke(new global::System.Windows.Forms.MethodInvoker(() => ShowProgress(e))); } else { ShowProgress(e); } clientBusy = false; // 20171214 The HandleClientProgress method is executed once a // message has been succesfully sent. }
private void Initialize() { global::System.Drawing.Size screenSize = global::System.Windows.Forms.Screen.GetBounds(this).Size; this.Location = new global::System.Drawing.Point(screenSize.Width - this.Width, screenSize.Height - this.Height); mainTabControl.SelectedTab = inputTabPage; continuousSpeechRecognitionControl.SoundRecognized += new global::System.EventHandler <global::AuxiliaryLibrary.StringEventArgs>(HandleContinuousSoundRecognized); continuousSpeechRecognitionControl.SoundDetected += new global::System.EventHandler <global::AudioLibrary.WAVSoundEventArgs>(HandleContinuousSoundDetected); global::System.Collections.Generic.List <string> recordingDeviceNameList = global::AudioLibrary.WAVRecorder.GetDeviceNames(); recordingDeviceComboBox.Items.Clear(); foreach (string recordingDeviceName in recordingDeviceNameList) { recordingDeviceComboBox.Items.Add(recordingDeviceName); } if (recordingDeviceNameList.Count > 0) { recordingDeviceComboBox.SelectedIndex = recordingDeviceID; } clientBusy = false; }
private void HandleContinuousSoundRecognized(object sender, global::AuxiliaryLibrary.StringEventArgs e) { if (!clientBusy) { clientBusy = true; clientThread = new global::System.Threading.Thread(new global::System.Threading.ThreadStart(() => SendMessage(e.StringValue))); clientThread.Start(); } // client.Send(e.StringValue); if (continuousSpeechRecognitionControl.ExtractDetectedSounds == true) { if (InvokeRequired) { this.BeginInvoke(new global::System.Windows.Forms.MethodInvoker(() => ShowContinuousRecognizedSound(e.StringValue))); } else { ShowContinuousRecognizedSound(e.StringValue); } } }
private void HandleClientError(object sender, global::CommunicationLibrary.CommunicationErrorEventArgs e) { clientBusy = false; // 20171214 The HandleClientError methods is executed if the // client fails to send the message. }