Ejemplo n.º 1
0
        /// <summary>
        /// Update the voice commands with the voice command description message sent by speech recognition modules
        /// </summary>
        /// <param name="command">Command description</param>
        public void Update(VoiceCommandDescription command)
        {
            if (command != null)
            {
                if (_current != null)
                {
                    _previous = _current;
                }
                else
                {
                    _current = new VoiceCommand();
                }

                if (_previous == null)
                {
                    _previous = new VoiceCommand
                    {
                        Active = command.active,
                        Command = command.command,
                        Confidence = command.confidence,
                        Language = command.language,
                        TriggerAt = FromString(command.triggeredAt)
                    };
                }

                _current.Active = command.active;
                _current.Command = command.command;
                _current.Confidence = command.confidence;
                _current.Language = command.language;
                _current.TriggerAt = FromString(command.triggeredAt);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Update the voice command from the human
 /// </summary>
 /// <param name="command">Voice command</param>
 public void Update(VoiceCommandDescription command)
 {
     lock (_object)
     {
         if (VoiceCommandManager != null)
         {
             //Log.InfoFormat("Updating the voice commands");
             VoiceCommandManager.Update(command);
         }
     }
 }