Home

Awesome

Unity-Text-to-Speech

Sample app used to demonstrate the use of Microsoft Cognitive Services Speech Service Text-to-Speech (TTS) APIs from within the Unity game engine. These cloud-based APIs provide access to higher quality voices, providing consistency across all client platforms. Check out the Text-to-Speech Overview page to try out & hear a sample of these voices.

This sample provides a self-contained SpeechManager component that is easy to reuse in your own Unity projects. Given that Cognitive Services are cloud APIs, they are therefore not available when offline. It is recommended to fallback on local platform-specific Text-to-Speech APIs when offline.

The code in this sample demonstrates two ways to call the Speech Synthesis service. The first makes use of the Text-to-Speech REST API endpoint. When running the sample, make sure the checkbox "Use SDK Plugin" is unchecked to use this method. The second approach uses the new Cognitive Services Speech SDK for Unity, which features a plugin for Windows Desktop, UWP and Android, available as part of of a Unity package. IMPORTANT: The plugin is not included with this repo and you must import it in your project or the sample won't run. You can download the Unity package from here.

Implementation Notes

Follow Me