private void _recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Result != null) { RecognizedText.Text = e.Result.Text; var semantics = e.Result.Semantics; var commandKey = semantics[GrammarKeys.SemanticKey_Command].Value.ToString(); _responder.Say(_enabledCommands[commandKey].ConfirmationText); System.Threading.Thread.Sleep(1000); System.Diagnostics.Debug.WriteLine("Found semantic key command" + commandKey); if (!IsTestOnlyMode) { ExecuteCommandInList(commandKey); } } else { RecognizedText.Text = "I did not understand your utterance"; } }
private void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { String resultText = e.Result != null ? e.Result.Text : "<null>"; Log("RecognizeCompleted (" + DateTime.Now.ToString("mm:ss.f") + "): " + resultText); Log("BabbleTimeout: " + e.BabbleTimeout + "; InitialSilenceTimeout: " + e.InitialSilenceTimeout + "; Result text: " + resultText); }
// Handle the RecognizeCompleted event. private void RecognizeCompletedHandler( object sender, RecognizeCompletedEventArgs e) { if (e.Error != null) { Console.WriteLine(" Error encountered, {0}: {1}", e.Error.GetType().Name, e.Error.Message); } if (e.Cancelled) { Console.WriteLine(" Operation cancelled."); } if (e.InputStreamEnded) { Program a = new Program(); if (recognizedText == null) { recognizedText = "text not found"; Program.SendMessage(recognizedText, this.sockets); Console.WriteLine(" End of stream encountered."); qw.Close(); File.Delete(@"D:\Temp\myFile2.wav"); } else { Program.SendMessage(recognizedText, this.sockets); Console.WriteLine(" End of stream encountered."); qw.Close(); File.Delete(@"D:\Temp\myFile2.wav"); } } completed = true; }
// Private Methods (8) void recognizeCompleted(object sender, RecognizeCompletedEventArgs e) { IsRunning = false; RecognizeEnd("Recognize Completed."); updatePosition(); if (RecognizeCompleted == null) { return; } RecognizeCompleted("Recognize Completed."); if (e.Error != null) { RecognizeCompleted(string.Format("Error encountered, {0}: {1}", e.Error.GetType().Name, e.Error.Message)); } if (e.Cancelled) { RecognizeCompleted("Operation cancelled."); } if (e.InputStreamEnded) { RecognizeCompleted("End of stream encountered."); } }
private static void RecognizeCompletedHandler(object sender, RecognizeCompletedEventArgs e) // Handle the RecognizeCompleted event. { Debug.WriteLine(" In RecognizeCompletedHandler."); if (e.Error != null) { Debug.WriteLine(" - Error occurred during recognition: {0}", e.Error); return; } if (e.InitialSilenceTimeout || e.BabbleTimeout) { Debug.WriteLine(" - BabbleTimeout = {0}; InitialSilenceTimeout = {1}", e.BabbleTimeout, e.InitialSilenceTimeout); return; } if (e.InputStreamEnded) { Debug.WriteLine(" - AudioPosition = {0}; InputStreamEnded = {1}", e.AudioPosition, e.InputStreamEnded); } if (e.Result != null) { Debug.WriteLine(" - Grammar = {0}; Text = {1}; Confidence = {2}", e.Result.Grammar.Name, e.Result.Text, e.Result.Confidence); Debug.WriteLine(" - AudioPosition = {0}", e.AudioPosition); } else { Debug.WriteLine(" - No result."); } completed = true; }
private void OnRecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Cancelled) { _isRunning = false; } }
private void RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Result != null) { Debug.WriteLine("Recognize completed '" + e.Result.Text + "'."); } }
/// <summary> /// 音声認識が終了した場合のイベント /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SpeechRecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Result != null && _speechRecognizeCompletedEvent != null) { _speechRecognizeCompletedEvent(e); } }
private void onSpeechRecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (this.simText.Length > 0) { this.speechRecognitionEngine.EmulateRecognizeAsync(this.simText); } }
/// <summary> /// An async recognize has completed. /// </summary> private void sre_RecognizeCompleted(object sender, RecognizeCompletedEventArgs args) { State = VoiceRecognizerState.Paused; // Signal that async recognize has completed EngineShuttingDown.Set(); }
// Handle the RecognizeCompleted event. static void RecognizeCompletedHandler(object sender, RecognizeCompletedEventArgs e) { Console.WriteLine(" In RecognizeCompletedHandler."); if (e.Error != null) { Console.WriteLine(" - Error occurred during recognition: {0}", e.Error); return; } if (e.InitialSilenceTimeout || e.BabbleTimeout) { Console.WriteLine(" - BabbleTimeout = {0}; InitialSilenceTimeout = {1}", e.BabbleTimeout, e.InitialSilenceTimeout); return; } if (e.InputStreamEnded) { Console.WriteLine(" - AudioPosition = {0}; InputStreamEnded = {1}", e.AudioPosition, e.InputStreamEnded); } if (e.Result != null) { Console.WriteLine(" - Grammar = {0}; Text = {1}; Confidence = {2}", e.Result.Grammar.Name, e.Result.Text, e.Result.Confidence); Console.WriteLine(" - AudioPosition = {0}", e.AudioPosition); } else { Console.WriteLine(" - No result."); } _completed = true; }
private void speechRecognizer_SpeechRecognized(object sender, RecognizeCompletedEventArgs e) { if (e.Result == null) { return; } foreach (FlyingData data in this.flyingDataList) { string text = DataMgr.Instance.ActiveObjectCollection[data.Index].Text; string[] texts = text.Split(new char[] { '$' }); bool found = false; foreach (string temp in texts) { if (temp.Equals(e.Result.Text, StringComparison.OrdinalIgnoreCase)) { this.ballonCrack(data); found = true; break; } } if (found) { break; } } }
static void sre_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Error != null) { Console.WriteLine("RecognizeCompleted, error occurred during recognition: {0}", e.Error); return; } if (e.InitialSilenceTimeout || e.BabbleTimeout) { Console.WriteLine("RecognizeCompleted: BabbleTimeout({0}), InitialSilenceTimeout({1}).", e.BabbleTimeout, e.InitialSilenceTimeout); return; } if (e.InputStreamEnded) { Console.WriteLine("RecognizeCompleted: AudioPosition({0}), InputStreamEnded({1}).", e.AudioPosition, e.InputStreamEnded); } if (e.Result != null) { Console.WriteLine("RecognizeCompleted-> Grammar: " + e.Result.Grammar.Name + " Recognized text: " + e.Result.Text + " Confidence score: " + e.Result.Confidence + " Audio position: " + e.AudioPosition); } else { Console.WriteLine("RecognizeCompleted: No result."); } }
// 音声認識が終了した場合のイベント private static void SpeechRecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Result != null && SpeechRecognizeCompletedEvent != null) { SpeechRecognizeCompletedEvent(e.Cancelled); } }
private void SpeechRecognized(object sender, RecognizeCompletedEventArgs e) { if (e.Result != null) { UserText = e.Result.Text; CommandManager.InvalidateRequerySuggested(); } }
/// <summary> /// Called when the engine finalizes the recognition operation. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An object that contains the event data.</param> private void OnRecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { DateTime originatingTime = this.streamStartTime + e.AudioPosition; this.PostWithOriginatingTimeConsistencyCheck(this.RecognizeCompleted, e, originatingTime); this.recognizeComplete.Set(); }
private void RecognitionEngine_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { btnRestart.Enabled = true; btnStart.Enabled = true; btnStop.Enabled = false; toolStripProgressBar1.Visible = false; toolStripStatusLabelStatus.Text = "All recognized"; }
private void SpeechRecognitionEngine_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { Logger.Info($"{MethodBase.GetCurrentMethod().Name} - Done with recognition ..."); if (this.CaptureCatImage) { this.speechRecognitionEngine.RecognizeAsync(RecognizeMode.Single); } }
protected void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { String resultText = e.Result != null ? e.Result.Text : "<null>"; cfg.logInfo("ENGINE - " + Name, "RecognizeCompleted (" + DateTime.Now.ToString("mm:ss.f") + "): " + resultText); cfg.logDebug("ENGINE - " + Name, "BabbleTimeout: " + e.BabbleTimeout + "; InitialSilenceTimeout: " + e.InitialSilenceTimeout + "; Result text: " + resultText); // StartRecognizer(); }
static void sre_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Result == null) { return; } Console.WriteLine("Reconhecido: " + e.Result.Text); }
void Engine_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { this.IsBusy = false; if (this.RecognizeCompleted != null) { this.RecognizeCompleted(this, e); } }
private void RecognizeCompletedHandler( object sender, RecognizeCompletedEventArgs e) { _completed = true; if (e.Result != null) { _com = e.Result.Text; Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)(NextStep)); } }
private void RecognizeCompletedEventHandler(object sender, RecognizeCompletedEventArgs e) { ASR_Module.ASR.RecognitionEngine.RecognizeAsyncCancel(); if (e.Result == null) { Console.WriteLine("Recognize Completed: Nie rozpoznano"); CurrentForm.Field.NoMatch.ReadMessage(); } FormInterpretationAlgorithm(NextForm); }
void reco_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { // m_txtBoxWriteToTextURL.AppendText("Recognition Complete!"); // Console.WriteLine("Recognition Complete!"); using (StreamWriter w = File.AppendText(m_txtBoxWriteToTextURL.Text)) { Log("----------------------------------Recognition Complete!---------------------------------------------", w); } }
private static void RecognizeCompletedHandler( object sender, RecognizeCompletedEventArgs e) { _completed = true; if (e.Result != null) { Console.WriteLine(" Recognition completed.{0}", e.Result.Text); _liter = !_liter; } }
private static void RecognizeCompletedHandler( object sender, RecognizeCompletedEventArgs e) { _completed = true; if (e.Result != null) { Console.WriteLine(" Recognition completed.{0}", e.Result.Text); _liter = !_liter; } }
void localSR_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (this.InvokeRequired) { this.Invoke(new EventHandler <RecognizeCompletedEventArgs>(localSR_RecognizeCompleted), sender, e); return; } btnLocalSR.Text = localSR.Recognizing ? "停止录音" : "开始录音"; }
private void OnSpeechRecognized(object sender, RecognizeCompletedEventArgs e) { try { _rec.RecognizeAsyncStop(); _isListening = false; if (e.Result != null && !string.IsNullOrEmpty(_rejected)) { // Handle answer to precision question _dte.StatusBar.Clear(); if (e.Result.Text == "yes") { _cache.ExecuteCommand(_rejected); } _rejected = null; } else if (e.Result != null && e.Result.Text == "what can I say") {// Show link to command list System.Diagnostics.Process.Start("https://github.com/ligershark/VoiceExtension/blob/master/src/Resources/commands.txt"); _dte.StatusBar.Clear(); Telemetry.TrackEvent("Show command list"); } else if (e.Result != null && e.Result.Confidence > _minConfidence) { // Speech matches a command _cache.ExecuteCommand(e.Result.Text); var props = new Dictionary <string, string> { { "phrase", e.Result.Text } }; Telemetry.TrackEvent("Match", props); } else if (string.IsNullOrEmpty(_rejected)) { // Speech didn't match a command _dte.StatusBar.Text = "I didn't quite get that. Please try again."; Telemetry.TrackEvent("No match"); } else if (e.Result == null && !string.IsNullOrEmpty(_rejected) && !e.InitialSilenceTimeout) { // Keep listening when asked about rejected speech _rec.RecognizeAsync(); Telemetry.TrackEvent("Low confidence"); } else { // No match or timeout _dte.StatusBar.Clear(); } } catch (Exception ex) { _dte.StatusBar.Clear(); Logger.Log(ex); } }
private static void Recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { /*completed = true; * Console.WriteLine(e.BabbleTimeout); * Console.WriteLine(e.Cancelled); * Console.WriteLine(e.Error); * Console.WriteLine(e.InitialSilenceTimeout); * Console.WriteLine(e.InputStreamEnded); * Console.WriteLine(e.UserState);*/ Console.WriteLine("Speech Recognition Complete!"); //Console.WriteLine(e.Result.Text); }
private void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Error != null) { MessageBox.Show($@"Error encountered, {e.Error.GetType().Name}: {e.Error.Message}"); } else if (e.Cancelled) { MessageBox.Show(@" Operation cancelled."); } this._completed = true; this.SetComplete(true); }
private void speechRecognizer_SpeechRecognized(object sender, RecognizeCompletedEventArgs e) { ReadCountItem item = this.readCountResultListBox.SelectedItem as ReadCountItem; if (item == null || e.Result == null) { return; } int count = 0; int.TryParse(e.Result.Text, out count); item.Result = count; }
private void SpeechRecognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (this.recognizerCallback != null) { this.recognizerCallback(this, e); } if (!this.RecognizerEnabled) { return; } ((SpeechRecognitionEngine)sender).RecognizeAsyncStop(); ((SpeechRecognitionEngine)sender).RecognizeAsync(RecognizeMode.Single); }
private void SpeechRecognitionEngine_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { systemLog.DebugFormat("{0} Recognize completed", prefix); //systemLog.DebugFormat(" Babble timeout: {0}", e.BabbleTimeout); //systemLog.DebugFormat(" Cancelled: {0}", e.Cancelled); //systemLog.DebugFormat(" Error: {0}", e.Error?.Message); //systemLog.DebugFormat(" Initial Silence Timeout: {0}", e.InitialSilenceTimeout); //systemLog.DebugFormat(" Input Stream Ended: {0}", e.InputStreamEnded); if (e.Error != null) { systemLog.Error(prefix + " " + e.Error.Message, e.Error); } stream = null; }
// Handle the RecognizeCompleted event. static void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Error != null) { Console.WriteLine(" Error encountered, {0}: {1}", e.Error.GetType().Name, e.Error.Message); } if (e.Cancelled) { Console.WriteLine(" Operation cancelled."); } if (e.InputStreamEnded) { Console.WriteLine(" End of stream encountered."); } completed = true; }
protected void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { String resultText = e.Result != null ? e.Result.Text : "<null>"; logInfo("ENGINE", "RecognizeCompleted (" + DateTime.Now.ToString("mm:ss.f") + "): " + resultText); // logInfo("[Engine] BabbleTimeout: {0}; InitialSilenceTimeout: {1}; Result text: {2}", e.BabbleTimeout, e.InitialSilenceTimeout, resultText); StartRecognizer(); }
void sre_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { }
void engine_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { parar_botao.IsEnabled = false; falar_botao.IsEnabled = true; }
/// <summary> /// An async recognize has completed. /// </summary> private void sre_RecognizeCompleted(object sender, RecognizeCompletedEventArgs args) { State = VoiceRecognizerState.Paused; // Signal that async recognize has completed EngineShuttingDown.Set(); }
protected void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { String resultText = e.Result != null ? e.Result.Text : "<null>"; cfg.logInfo("ENGINE - " + Name, "RecognizeCompleted (" + DateTime.Now.ToString("mm:ss.f") + "): " + resultText); cfg.logDebug("ENGINE - " + Name, "BabbleTimeout: " + e.BabbleTimeout + "; InitialSilenceTimeout: " + e.InitialSilenceTimeout + "; Result text: " + resultText); // StartRecognizer(); }
private void sr_RecognizeCompletedHandler(object sender, RecognizeCompletedEventArgs e) { }
private void RecognizeCompletedHandler(object sender, RecognizeCompletedEventArgs e) { if (e.Error != null) { Console.WriteLine( "RecognizeCompleted, error occurred during recognition: {0}\n{1}", e.Error.GetType().Name, e.Error.Message); return; } if (e.InitialSilenceTimeout || e.BabbleTimeout) { Console.WriteLine( "RecognizeCompleted: BabbleTimeout({0}), InitialSilenceTimeout({1}).", e.BabbleTimeout, e.InitialSilenceTimeout); return; } if (e.Cancelled) { Console.WriteLine(" Operation cancelled."); return; } if (e.InputStreamEnded) { Console.WriteLine(" End of stream encountered."); return; } if (e.InputStreamEnded) { Console.WriteLine( "RecognizeCompleted, End of stream encountered: AudioPosition({0}), InputStreamEnded({1}).", e.AudioPosition, e.InputStreamEnded); return; } if (e.Result != null) { Console.WriteLine("RecognizeCompleted:"); Console.WriteLine(" Grammar: " + e.Result.Grammar.Name); Console.WriteLine(" Recognized text: " + e.Result.Text); Console.WriteLine(" Confidence score: " + e.Result.Confidence); Console.WriteLine(" Audio position: " + e.AudioPosition); } else { Console.WriteLine("RecognizeCompleted: No result."); } }
private void OnSpeechRecognized(object sender, RecognizeCompletedEventArgs e) { _rec.RecognizeAsyncStop(); _isListening = false; if (e.Result != null && !string.IsNullOrEmpty(_rejected)) { // Handle answer to precision question _dte.StatusBar.Clear(); if (e.Result.Text == "yes") _cache.ExecuteCommand(_rejected); _rejected = null; } else if (e.Result != null && e.Result.Text == "what can I say") {// Show link to command list System.Diagnostics.Process.Start("https://raw.github.com/ligershark/VoiceExtension/master/VoiceExtension/Resources/commands.txt"); _dte.StatusBar.Clear(); } else if (e.Result != null && e.Result.Confidence > _minConfidence) { // Speech matches a command _cache.ExecuteCommand(e.Result.Text); } else if (string.IsNullOrEmpty(_rejected)) { // Speech didn't match a command _dte.StatusBar.Text = "I didn't quite get that. Please try again."; } else if (e.Result == null && !string.IsNullOrEmpty(_rejected) && !e.InitialSilenceTimeout) { // Keep listening when asked about rejected speech _rec.RecognizeAsync(); } else { // No match or timeout _dte.StatusBar.Clear(); } }
protected void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { String resultText = e.Result != null ? e.Result.Text : "<null>"; Log("RecognizeCompleted (" + DateTime.Now.ToString("mm:ss.f") + "): " + resultText); Debug("BabbleTimeout: " + e.BabbleTimeout + "; InitialSilenceTimeout: " + e.InitialSilenceTimeout + "; Result text: " + resultText); }
private void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { recognizer.RecognizeAsync(); }
private void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Error != null) { Console.WriteLine( "RecognizeCompleted, error occurred during recognition: {0}", e.Error); return; } if (e.InitialSilenceTimeout || e.BabbleTimeout) { Console.WriteLine( "RecognizeCompleted: BabbleTimeout({0}), InitialSilenceTimeout({1}).", e.BabbleTimeout, e.InitialSilenceTimeout); return; } if (e.InputStreamEnded) { Console.WriteLine("RecognizeCompleted: AudioPosition({0}), InputStreamEnded({1}).", e.AudioPosition, e.InputStreamEnded); output += "</body></html>"; txtOutput.Text = output; } if (e.Result != null) { Console.WriteLine("RecognizeCompleted:"); Console.WriteLine(" Grammar: " + e.Result.Grammar.Name); Console.WriteLine(" Recognized text: " + e.Result.Text); Console.WriteLine(" Confidence score: " + e.Result.Confidence); Console.WriteLine(" Audio position: " + e.AudioPosition); } else { Console.WriteLine("RecognizeCompleted: No result."); } }
// RecognizeCompleted event is generated by SpeechRecognitionEngine when // an asynchronous recognition operation completes. void SpeechEngine_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { _isRecognizing = false; UpdateGroupBoxAudioInput(); UpdateGroupBoxRecognitionSRE(); }
private void RecognizeCompletedHandler(object sender, RecognizeCompletedEventArgs e) { if (e.InputStreamEnded) { (lstAudio.Items[curAudio] as AudioFile).Status = "Procesado"; lstAudio.Items.Refresh(); curAudio++; if (curAudio != texts.Count) { ProcessAudio(); } else { output += "</body>\n</html>"; txtOutput.Text = output; Console.WriteLine("Recognition complete: {0} - {1}", e.AudioPosition, e.InputStreamEnded); lblProgress.Content = "Progreso: Terminado"; MessageBox.Show("Proceso finalizado"); btnLoadDir.IsEnabled = true; btnProcess.IsEnabled = true; btnSave.IsEnabled = true; } } }
private void onSpeechRecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (this.simText.Length > 0) { this.speechRecognitionEngine.EmulateRecognizeAsync(this.simText); } }
// Handle the SpeechRecognized event. protected void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { string resultText = e.Result != null ? e.Result.Text : "<null>"; Console.WriteLine("[Engine] RecognizeCompleted ({0}): {1}", DateTime.Now.ToString("mm:ss.f"), resultText); // Console.WriteLine("[Engine] BabbleTimeout: {0}; InitialSilenceTimeout: {1}; Result text: {2}", e.BabbleTimeout, e.InitialSilenceTimeout, resultText); this.start = false; StartRecognizer(); }
/// <summary> /// Recognition was stoped, check if it was reset and needs to be started again /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Cancelled && reset) { waiting = false; reset = false; UpdateGrammar(); recognizer.RecognizeAsync(RecognizeMode.Multiple); } }
private void onContinuousRecognitionResult(object sender, RecognizeCompletedEventArgs args) { //m_reco_continuous.RecognizeAsyncCancel(); if (args.Result != null) { Bottle bReco = new Bottle(); bReco.clear(); //Console.WriteLine("Continuous reco : " + args.Result.Text); foreach (RecognizedWordUnit word in args.Result.Words) { bReco.addString(word.Text); bReco.addDouble(word.Confidence); } m_portContinuousRecognition.write(bReco); Console.WriteLine("Async. Recog : " + bReco.toString_c().c_str()); } m_reco_continuous.RecognizeAsync(); }
private void MySpeechRecognitionEngine_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { }
private void sre_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Cancelled) { sre.RecognizeAsync(RecognizeMode.Multiple); AddToList("SRE reset"); } }
/// \brief Handles Recognition Complete Events private void speechRecognizeCompleteHandler(object sender, RecognizeCompletedEventArgs e) { if(!e.Cancelled) speechRecogEngine.RecognizeAsync(RecognizeMode.Single); }
void sre_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { //MessageBox.Show(String.Format("{0} alternatives found, {1} sure that you said {2}", e.Result.Alternates.Count, e.Result.Confidence, e.Result.Text)); if (e.Result != null) { int guess = int.Parse(e.Result.Text); if (guess < correctNumber) ss.Speak("Too small. Guess again."); if (guess > correctNumber) ss.Speak("Too big. Guess again."); if (guess == correctNumber) { ss.Speak("Correct!"); return; } } sre.RecognizeAsync(RecognizeMode.Single); }
void sRecognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (e.Result != null&&e.Result.Text != "Lili") { if (chkbMusic.Checked) { player.PlayLooping(); } } }
private void RecognizeCompletedHandler( object sender, RecognizeCompletedEventArgs e) { _completed = true; if (e.Result != null) { _com = e.Result.Text; Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action) (NextStep)); } }
void mRecognitionEngine_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (commandToEmulate != "") { mRecognitionEngine.EmulateRecognizeAsync(commandToEmulate); commandToEmulate = ""; } }
void recognitionEngine_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { if (!isSpeechRecoActive && e.Cancelled) { recognitionEngine.SetInputToNull(); } }
void recognizer_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e) { int senderHash = sender.GetHashCode(); string ID = ""; lock (engines) { foreach (AudioInstance ai in engines) { if (ai.engine.GetHashCode() == senderHash) { //ai.engine.RecognizeAsyncCancel(); ai.engine.SetInputToNull(); ai.audioStream = null; ai.Active = false; ID = ai.ID; } } } OnRecognitionComplete(ID); }