private void oRecognizer_SpeechRecognized(object sender, System.Speech.Recognition.SpeechRecognizedEventArgs e) { DataSet dsResults = new DataSet(); String sPattern = ""; try { if ((e.Result.Text == gWakePhrase) & (gVRMuted == true)) { gVRMuted = false; lblStatus.Content = "I am awake"; } else if ((e.Result.Text == gSleepPhrase) & (gVRMuted == false)) { gVRMuted = true; lblStatus.Content = "I am sleeping"; } // gSpeechPlugin; String temp = OSAEApi.GetObjectPropertyValue(gSpeechPlugin, "Speaking").Value.ToString().ToLower(); if (temp.ToLower() == "true") { try { AddToLog("Ignored Speech because TTS was talking."); } catch (Exception ex) { } } else { if ((gVRMuted == false) || (e.Result.Text == gSleepPhrase) || (e.Result.Text == gSleepPhrase)) { try { string sText = OSAEApi.MatchPattern(e.Result.Text); OSAEApi.MethodQueueAdd("Script Processor", "NAMED SCRIPT", sText, ""); AddToLog("Heard: " + e.Result.Text + ", Ran: " + sText); } catch (Exception ex) { } } } } catch (Exception ex) { AddToLog("Error in _SpeechRecognized: " + ex.Message); } }