private void LoadSpeechRecognitionGrammarsForUI() //TODO: split into separate methods and load based on current context, instead of loading all together { speechRecognition.Pause(); LoadSpeechRecognitionGrammar("SpeechGrammar_Manager_en.xml", "Manager"); LoadSpeechRecognitionGrammar("SpeechGrammar_Editor_en.xml", "Editor"); LoadSpeechRecognitionGrammar("SpeechGrammar_Visualizer_en.xml", "Visualizer"); speechRecognition.Resume(); }
public void Speak(string s) { if (speechSynthesis == null) { return; } if (speechRecognition != null) { speechRecognition.Pause(); } speechSynthesis.Speak(s); if (speechRecognition != null) { speechRecognition.Resume(); } }
public void SpeakCommand(string command) { speechRecognition.Pause(); speechSynthesis.Speak(command); speechRecognition.Resume(); }