// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.MixedReality.Toolkit.Utilities; using System; using UnityEngine.EventSystems; namespace Microsoft.MixedReality.Toolkit.Input { /// /// Describes an input event that involves keyword recognition. /// public class SpeechEventData : BaseInputEventData { /// /// The time it took for the phrase to be uttered. /// public TimeSpan PhraseDuration { get; private set; } /// /// The moment in UTC time when uttering of the phrase began. /// public DateTime PhraseStartTime { get; private set; } /// /// The text that was recognized. /// public SpeechCommands Command { get; private set; } /// /// A measure of correct recognition certainty. /// public RecognitionConfidenceLevel Confidence { get; private set; } /// public SpeechEventData(EventSystem eventSystem) : base(eventSystem) { } /// /// Populates the event with data. /// public void Initialize(IMixedRealityInputSource inputSource, RecognitionConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SpeechCommands command) { BaseInitialize(inputSource, command.Action); Confidence = confidence; PhraseDuration = phraseDuration; PhraseStartTime = phraseStartTime; Command = command; } } }