コード例 #1
0
        private void Kit_SensorChange(object sender, Phidgets.Events.SensorChangeEventArgs e)
        {
            Phidgets.InterfaceKit kit = sender as Phidgets.InterfaceKit;

            ServerMessage message = new ServerMessage()
            {
                OtherSensorsInfo = new SensorInfo(kit.ID.ToString(), kit.SerialNumber, e.Index, e.Value)
            };

            WebSocketsHandler.Instance().SendToClients(message.ToJSON());
        }
コード例 #2
0
        private KinectHandler()
        {
            SensorChooser = new KinectSensorChooser();
            SensorChooser.KinectChanged += SensorChooserOnKinectChanged;


            SensorChooser.Start();

            KinectGestureGenerator = new GestureGenerator();
            KinectGestureGenerator.GestureRecognized += KinectGestureGenerator_GestureRecognized;
            SensorChooser.Kinect.SkeletonFrameReady  += Kinect_SkeletonFrameReady;

            Webserver = WebSocketsHandler.Instance();

            Webserver.Register(this);
        }
コード例 #3
0
 //Speech is recognised
 private void SreSpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     //Very important! - change this value to adjust accuracy - the higher the value
     //the more accurate it will have to be, lower it if it is not recognizing you
     if (e.Result.Confidence < 0.8)
     {
         RejectSpeech(e.Result);
     }
     else
     {
         //and finally, here we set what we want to happen when
         //the SRE recognizes a word
         WebSocketsHandler.Instance().SendToClients(new ServerMessage()
         {
             SpeechText = e.Result.Text.ToUpperInvariant()
         }.ToJSON());
     }
 }
コード例 #4
0
 public static WebSocketsHandler Initialize()
 {
     return(_webSocketsHandler = new WebSocketsHandler());
 }