Voice SDK’s Text-to-Speech (TTS) feature uses a Wit.ai service to provide audio files for text strings. It’s handled by a simple WitTTSSpeaker Blueprint for for each scene location in which a TTS clip can be played.
To keep TTS working smoothly, Voice SDK handles the caching of TTS files during runtime (or when otherwise needed).
Note: With this initial release of TTS, only a few Wit.ai TTS voice settings are adjustable, but the package will be updated as more voices become available.
To set up TTS for your app, follow these steps:
In Unreal, create a Blueprint class from WitTtsSpeaker.
Add the WitTtsSpeaker Blueprint to your scene.
In the World Outliner window, select WitTtsSpeaker and adjust the settings to fit your needs:
Go to TTS > Configuration and select the wit configuration file for your app from the list.
Under Voice Preset, select Update Voice List to refresh the list of voices and voice styles that are available from Wit.ai. For more information, see TTS Voice Customization.
Under TTS Runtime Cache (Script), adjust the settings to indicate how often clips will be automatically uploaded from memory. For more information, see TTS Cache Options.
If needed, adjust your disk cache directory location and name. To do this, go to TTS Cache > Storage > Cache Directory. For more information, see TTS Cache Options.
Add the WitTtsSpearker Blueprint to all the locations in your app where you would like TTS to be played.
Modify each occurrence of the WitTtsSpeaker Blueprint to reflect specific needs for that location using the Detail window for that occurrence.
Under TTS, select the Voice Preset for the specific speaker.
In the WitTtsSpeaker Blueprints, use the appropriate methods to make any changes needed:
Use the WitTtsSpeaker’s Speak(text) method to request and say specified text.
Use the WitTtsSpeaker’s Stop() method to immediately stop any playing TTS clips.
Open the WitTtsSpeaker Blueprint, select the Wit Tts Service component, and expand Events to add information for any clip loading or playback events.