2
2
// Licensed under the MIT License. See LICENSE in the project root for license information.
3
3
4
4
using System . Collections ;
5
- using System . Text ;
6
5
using UnityEngine ;
7
6
8
7
#if UNITY_WSA || UNITY_STANDALONE_WIN
8
+ using System . Text ;
9
9
using UnityEngine . Windows . Speech ;
10
10
#endif
11
11
@@ -17,6 +17,7 @@ namespace HoloToolkit.Unity.InputModule
17
17
/// </summary>
18
18
public class DictationInputManager : Singleton < DictationInputManager > , IInputSource
19
19
{
20
+ #if UNITY_WSA || UNITY_STANDALONE_WIN
20
21
/// <summary>
21
22
/// Caches the text currently being displayed in dictation display text.
22
23
/// </summary>
@@ -47,12 +48,12 @@ public class DictationInputManager : Singleton<DictationInputManager>, IInputSou
47
48
/// Audio clip of the last dictation session.
48
49
/// </summary>
49
50
private static AudioClip dictationAudioClip ;
50
- #if UNITY_WSA || UNITY_STANDALONE_WIN
51
+
51
52
private static DictationRecognizer dictationRecognizer ;
52
- #endif
53
+
53
54
private static bool isTransitioning ;
54
-
55
55
private static bool hasFailed ;
56
+ #endif
56
57
57
58
#region Unity Methods
58
59
@@ -187,6 +188,7 @@ public static IEnumerator StopRecording()
187
188
}
188
189
189
190
#region Dictation Recognizer Callbacks
191
+ #if UNITY_WSA || UNITY_STANDALONE_WIN
190
192
191
193
/// <summary>
192
194
/// This event is fired while the user is talking. As the recognizer listens, it provides text of what it's heard so far.
@@ -200,7 +202,6 @@ private static void DictationRecognizer_DictationHypothesis(string text)
200
202
InputManager . Instance . RaiseDictationHypothesis ( Instance , 0 , dictationResult ) ;
201
203
}
202
204
203
- #if UNITY_WSA || UNITY_STANDALONE_WIN
204
205
/// <summary>
205
206
/// This event is fired after the user pauses, typically at the end of a sentence. The full recognized string is returned here.
206
207
/// </summary>
@@ -234,7 +235,6 @@ private static void DictationRecognizer_DictationComplete(DictationCompletionCau
234
235
textSoFar = null ;
235
236
dictationResult = string . Empty ;
236
237
}
237
- #endif
238
238
239
239
/// <summary>
240
240
/// This event is fired when an error occurs.
@@ -249,7 +249,7 @@ private static void DictationRecognizer_DictationError(string error, int hresult
249
249
textSoFar = null ;
250
250
dictationResult = string . Empty ;
251
251
}
252
-
252
+ #endif
253
253
#endregion // Dictation Recognizer Callbacks
254
254
255
255
#region IInputSource Implementation
0 commit comments