Exemple #1
0
 public static void RegisterCommand(params Command[] ToRegister)
 {
     foreach (Command c in ToRegister)
     {
         Commands.Add(c);
         SpeechEngine.LoadGrammar(c.grammar);
     }
 }
Exemple #2
0
        public static void InitialiseSpeech()
        {
            if (Commands.Count > 0)
            {
                foreach (var C in Commands)
                {
                    if (SpeechEngine.Grammars.Contains(C.grammar))
                    {
                        continue;
                    }
                    SpeechEngine.LoadGrammar(C.grammar);
                }

                SpeechEngine.SetInputToDefaultAudioDevice();

                SpeechEngine.RecognizeAsync(RecognizeMode.Multiple);
            }
        }