Closed MatthewSloyan closed 4 years ago
From research I found that "synthesizer.SpeakTextAsync(inputText)" blocks until the task is complete, which was causing the game to hang until the speech service returned. With slow internet, this hang could be a few seconds. To solve this I have implemented a task which starts a Coroutine. This waits until the result from Azure is returned. From multiple playtests this seems to have fixed the issue but it will needed to be tested on the Oculus Quest this week to confirm.
Code was adapted from: https://stackoverflow.com/questions/57897464/unity-freezes-for-2-seconds-while-microsoft-azure-text-to-speech-processes-input
From testing the game can hang sometimes until it returns a response from the speech service.