Skip to content

Commit 2030748

Browse files
committed
clean up
1 parent 8ecb54f commit 2030748

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

Assets/MixedRealityToolkit/_Core/Devices/VoiceInput/WindowsDictationInputDeviceManager.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public WindowsDictationInputDeviceManager(string name, uint priority) : base(nam
6363
/// <inheritdoc />
6464
public override void Enable()
6565
{
66-
#if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
6766
if (!Application.isPlaying) { return; }
6867

6968
if (InputSystem == null)
@@ -84,13 +83,11 @@ public override void Enable()
8483
dictationRecognizer.DictationResult += DictationRecognizer_DictationResult;
8584
dictationRecognizer.DictationComplete += DictationRecognizer_DictationComplete;
8685
dictationRecognizer.DictationError += DictationRecognizer_DictationError;
87-
#endif
8886
}
8987

9088
/// <inheritdoc />
9189
public override void Update()
9290
{
93-
#if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
9491
if (!Application.isPlaying || InputSystem == null) { return; }
9592

9693
if (!isTransitioning && IsListening && !Microphone.IsRecording(deviceName) && dictationRecognizer.Status == SpeechSystemStatus.Running)
@@ -104,13 +101,11 @@ public override void Update()
104101
hasFailed = true;
105102
InputSystem.RaiseDictationError(inputSource, "Dictation recognizer has failed!");
106103
}
107-
#endif
108104
}
109105

110106
/// <inheritdoc />
111107
public override async void Disable()
112108
{
113-
#if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
114109
if (Application.isPlaying && dictationRecognizer != null)
115110
{
116111
if (!isTransitioning && IsListening) { await StopRecordingAsync(); }
@@ -120,17 +115,14 @@ public override async void Disable()
120115
dictationRecognizer.DictationComplete -= DictationRecognizer_DictationComplete;
121116
dictationRecognizer.DictationError -= DictationRecognizer_DictationError;
122117
}
123-
#endif
124118
}
125119

126120
public override void Destroy()
127121
{
128-
#if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
129122
if (Application.isPlaying)
130123
{
131124
dictationRecognizer?.Dispose();
132125
}
133-
#endif
134126
}
135127

136128
/// <inheritdoc />
@@ -142,7 +134,6 @@ public async void StartRecording(GameObject listener, float initialSilenceTimeou
142134
/// <inheritdoc />
143135
public async Task StartRecordingAsync(GameObject listener = null, float initialSilenceTimeout = 5f, float autoSilenceTimeout = 20f, int recordingTime = 10, string micDeviceName = "")
144136
{
145-
#if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
146137
if (IsListening || isTransitioning || InputSystem == null)
147138
{
148139
Debug.LogWarning("Unable to start recording");
@@ -187,7 +178,6 @@ public async Task StartRecordingAsync(GameObject listener = null, float initialS
187178
dictationAudioClip = Microphone.Start(deviceName, false, recordingTime, samplingRate);
188179
textSoFar = new StringBuilder();
189180
isTransitioning = false;
190-
#endif
191181
}
192182

193183
/// <inheritdoc />
@@ -199,7 +189,6 @@ public async void StopRecording()
199189
/// <inheritdoc />
200190
public async Task<AudioClip> StopRecordingAsync()
201191
{
202-
#if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
203192
if (!IsListening || isTransitioning)
204193
{
205194
Debug.LogWarning("Unable to stop recording");
@@ -244,7 +233,6 @@ private void DictationRecognizer_DictationHypothesis(string text)
244233
InputSystem.RaiseDictationHypothesis(inputSource, dictationResult);
245234
}
246235

247-
#if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN
248236
/// <summary>
249237
/// This event is fired after the user pauses, typically at the end of a sentence. The full recognized string is returned here.
250238
/// </summary>

0 commit comments

Comments
 (0)