/// <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); } }
/// <summary> /// Constructor /// </summary> public VoiceCommandManager() { _previous = new VoiceCommand() { TriggerAt = DateTime.Now }; _current = new VoiceCommand() { TriggerAt = DateTime.Now }; }