// This method exists so that it can be easily called and return safely if the speech prereqs aren't installed.
        // We isolate the try/catch inside this class, and don't impose the need on the caller.
        public static SpeechRecognizer Create(KinectSensor kinect)
        {
            SpeechRecognizer recognizer = null;

            try
            {
                recognizer = new SpeechRecognizer(kinect);
            }
            catch (Exception)
            {
                // speech prereq isn't installed. a null recognizer will be handled properly by the app.
            }

            return recognizer;
        }
Esempio n. 2
0
        public void SlideRecognizerSaidSomething(object sender, SpeechRecognizer.SaidSomethingEventArgs e)
        {
            //if (!System.Object.ReferenceEquals(ScreenManager.GetScreens()[ScreenManager.NumScreens - 1], this))
            //    return;
            switch (e.Verb)
            {

                case SpeechRecognizer.Verbs.Capture:
                    //Console.WriteLine("*****SLIDE Recognized 'Capture'!!!!!!!!!!!!!!!!!!");
                    Captured();
                    break;
                case SpeechRecognizer.Verbs.New:
                    //Console.WriteLine("*****SLIDE Recognized 'New Slide'!!!!!!!!!!!!!!!!!!");
                    parentSlideMenu.NewSlide();
                    break;
                case SpeechRecognizer.Verbs.Back:
                    //Console.WriteLine("*****SLIDE Recognized 'Back'!!!!!!!!!!!!!!!!!!");
                   // parentSlideMenu.PreviousSlide();
                   // this.ExitScreen();
                    PreviousSlide();
                    break;
                case SpeechRecognizer.Verbs.Next:
                    //Console.WriteLine("*****SLIDE Recognized 'Next'!!!!!!!!!!!!!!!!!! ");
                    NextSlide();
                    //parentSlideMenu.NextSlide();
                    break;
            }
        }