private void OnVoiceCommandRecognized(object sender, VoiceCommandRecognizedEventArgs e)
    {
      if (screenType == ScreenType.Drive)
      {
        switch (e.VoiceCommand)
        {
          case KinectClient.VoiceCommandType.TakeOff:
            DroneTakeOff();//Qui tutti i comandi che servono
            kinectMessage = "Take off";
            break;
          case KinectClient.VoiceCommandType.Land: //qui lancio sempre il comando non serve verificare se è doppio
            droneClient.Land();
            kinectMessage = "Land";
            break;
          case KinectClient.VoiceCommandType.Emergency:
            droneClient.Emergency();
            kinectMessage = "Emergency";
            break;
          case KinectClient.VoiceCommandType.ChangeCamera:
            droneClient.Send(droneClient.Configuration.Video.Channel.Set(VideoChannelType.Next).ToCommand());
            kinectMessage = "Change camera";
            break;
          case KinectClient.VoiceCommandType.DetectFacesOn:
            detectFaces = true;
            kinectMessage = "Detect faces on";
            break;
          case KinectClient.VoiceCommandType.DetectFacesOff:
            detectFaces = false;
            kinectMessage = "Detect faces off";
            break;

        }
      }
    }
Пример #2
0
 protected virtual void OnVoiceCommandRecognized(VoiceCommandRecognizedEventArgs e)
 {
   if (VoiceCommandRecognized != null)
     VoiceCommandRecognized(this, e);
 }