July 2017
Beginner to intermediate
390 pages
10h 53m
English
We have two methods. One is the public PlayVoice(), the other is called ReadSpeechStream(). The first one is called by SendMessage("PlayVoice") in the GestureHelper class. The second one is the part that loads the voice data into the streams. Why did we do this?
The answer lies in the inner workings of Unity. The short answer is: we need to call several awaitable methods that work asynchronously, while also doing work that can only be done on the main thread.
Let us investigate. If we look at the work being done in the ReadSpeechStream method we can see the following steps:
Read now
Unlock full access