33
44using Microsoft . MixedReality . Toolkit . Input ;
55using Microsoft . MixedReality . Toolkit . Utilities ;
6- using System ;
7- using UnityEngine ;
8- using UInput = UnityEngine . Input ;
96
107#if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
8+ using System ;
9+ using UnityEngine ;
1110using UnityEngine . Windows . Speech ;
11+ using UInput = UnityEngine . Input ;
1212#endif // UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
1313
1414namespace Microsoft . MixedReality . Toolkit . Windows . Input
1515{
16- #if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
17-
1816 [ MixedRealityExtensionService ( SupportedPlatforms . WindowsStandalone | SupportedPlatforms . WindowsUniversal | SupportedPlatforms . WindowsEditor ) ]
1917 public class WindowsSpeechInputProvider : BaseDeviceManager , IMixedRealitySpeechSystem
2018 {
@@ -26,9 +24,9 @@ public class WindowsSpeechInputProvider : BaseDeviceManager, IMixedRealitySpeech
2624 /// <param name="priority">Service priority. Used to determine order of instantiation.</param>
2725 /// <param name="profile">The service's configuration profile.</param>
2826 public WindowsSpeechInputProvider (
29- IMixedRealityServiceRegistrar registrar ,
30- string name = null ,
31- uint priority = DefaultPriority ,
27+ IMixedRealityServiceRegistrar registrar ,
28+ string name = null ,
29+ uint priority = DefaultPriority ,
3230 BaseMixedRealityProfile profile = null ) : base ( registrar , name , priority , profile ) { }
3331
3432 /// <summary>
@@ -41,6 +39,12 @@ public WindowsSpeechInputProvider(
4139 /// </summary>
4240 public IMixedRealityInputSource InputSource = null ;
4341
42+ /// <summary>
43+ /// The minimum confidence level for the recognizer to fire an event.
44+ /// </summary>
45+ public RecognitionConfidenceLevel RecognitionConfidenceLevel { get ; set ; }
46+
47+ #if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
4448 private KeywordRecognizer keywordRecognizer ;
4549
4650 /// <inheritdoc />
@@ -49,8 +53,6 @@ public bool IsRecognitionActive
4953 get { return keywordRecognizer != null && keywordRecognizer . IsRunning ; }
5054 }
5155
52- public RecognitionConfidenceLevel RecognitionConfidenceLevel { get ; set ; }
53-
5456 /// <inheritdoc />
5557 public override void Enable ( )
5658 {
@@ -135,6 +137,6 @@ private void OnPhraseRecognized(ConfidenceLevel confidence, TimeSpan phraseDurat
135137 }
136138 }
137139 }
138- }
139140#endif // UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
141+ }
140142}
0 commit comments