Ejemplo n.º 1
0
        public void ProcessInput(NamedSpeechRecognizerResponse input)
        {
            switch (input.Status)
            {
            case NamedSpeechRecognizerResponse.StatusProperty.NameRecognized:
                ThreadPool.AddCommands(new TextScriptCommand("Computer.Speak Text=\"I'm ready.\""));
                break;

            case NamedSpeechRecognizerResponse.StatusProperty.NameRequired:
                ThreadPool.AddCommands(new TextScriptCommand("Computer.Speak Text=\"What was that?\""));
                break;

            case NamedSpeechRecognizerResponse.StatusProperty.PhraseRecognized:
                if (_speechRecognizedAction != null)
                {
                    ThreadPool.AddCommands(_speechRecognizedAction);
                }
                var command = GetCommand(input.Phrase);

                ThreadPool.AddCommands(command);
                break;
            }
        }