Skip to content

Commit 7ce9925

Browse files
added asserts for system status results
1 parent 197da06 commit 7ce9925

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ public async Task StartRecordingAsync(GameObject listener = null, float initialS
163163
}
164164

165165
await waitUntilPhraseRecognitionSystemHasStopped;
166+
Debug.Assert(PhraseRecognitionSystem.Status == SpeechSystemStatus.Stopped);
166167

167168
// Query the maximum frequency of the default microphone.
168169
int minSamplingRate; // Not used.
@@ -174,6 +175,7 @@ public async Task StartRecordingAsync(GameObject listener = null, float initialS
174175
dictationRecognizer.Start();
175176

176177
await waitUntilDictationRecognizerHasStarted;
178+
Debug.Assert(dictationRecognizer.Status == SpeechSystemStatus.Running);
177179

178180
if (dictationRecognizer.Status == SpeechSystemStatus.Failed)
179181
{
@@ -219,10 +221,12 @@ public async Task<AudioClip> StopRecordingAsync()
219221
}
220222

221223
await waitUntilDictationRecognizerHasStopped;
224+
Debug.Assert(dictationRecognizer.Status == SpeechSystemStatus.Stopped);
222225

223226
PhraseRecognitionSystem.Restart();
224227

225228
await waitUntilPhraseRecognitionSystemHasStarted;
229+
Debug.Assert(PhraseRecognitionSystem.Status == SpeechSystemStatus.Running);
226230

227231
isTransitioning = false;
228232
return dictationAudioClip;

0 commit comments

Comments
 (0)