コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: ardakara/Youmote
        private void SetupKinect()
        {
            if (KinectSensor.KinectSensors.Count == 0)
            {
                this.Title = "No Kinect connected";
            }
            else
            {
                //use first Kinect
                nui = KinectSensor.KinectSensors[0];

                //Initialize to do skeletal tracking
                nui.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
                nui.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30);
                nui.SkeletonStream.Enable(new TransformSmoothParameters()
                {
                    Smoothing = 0.5f,
                    Correction = 0.5f,
                    Prediction = 0.5f,
                    JitterRadius = 0.05f,
                    MaxDeviationRadius = 0.04f
                });
                nui.Start();

                //need 4 seconds for kinect speech to be ready
                int wait = 4;
                while (wait > 0)
                {
                    wait--;
                    Thread.Sleep(1000);
                }

                this.mySpeechRecognizer = new SpeechRecognizer(this);
                this.mySpeechRecognizer.Start(nui.AudioSource);

                //add event to receive skeleton data
                youmoteController = new YoumoteController(this);
                currentController = youmoteController;
                nui.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);
            }
        }
コード例 #2
0
 public SpeechExitHelpDetector(MainWindow win)
 {
     window = win;
     this.speechRecognizer = win.speechRecognizer;
 }
コード例 #3
0
 public SpeechOffOverrideDetector(MainWindow win)
 {
     window = win;
     this.speechRecognizer = win.speechRecognizer;
 }