コード例 #1
0
 public static void StopListeningExcept(Choices ch, Func RaiseFunc)
 {
     sre.UnloadAllGrammars();
     ch.Add(new string[] { "Hello David", "Hello Zira" });
     WatchForAndRaise(ch, RaiseFunc);
     Mouth.Speak("here when you need me");
 }
コード例 #2
0
 static void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     if (e.Result.Text == "Hello David")
     {
         Mouth.SetSpeaker("Microsoft David Desktop");
         Mouth.Speak("Hello " + Environment.MachineName);
         return;
     }
     else if (e.Result.Text == "Hello Zira")
     {
         Mouth.SetSpeaker("Microsoft Zira Desktop");
         Mouth.Speak("Hello " + Environment.MachineName);
         return;
     }
     Recognised(e.Result.Text);
 }