public void SpeechRecognised(object sender, SpeechRecognizedEventArgs e)
 {
     if (controlState.GetType() == typeof(CommandState) && e.Result.Grammar.Name == "command")
     {
         controlState.VoiceInput(e.Result.Text);
     }
     else if (controlState.GetType() == typeof(DictationState) && e.Result.Grammar.Name == "dictation")
     {
         controlState.VoiceInput(e.Result.Text);
     }
 }
Example #2
0
 public void VoiceInput(string voiceData, string grammarName)
 {
     //Sending the voice input to the current state
     currentState.VoiceInput(voiceData, grammarName);
 }