Table Of Contents
All player and NPC chat are converted into synthetic speech via Google Cloud Text-to-speech. Player text can be detected as non-English, in this case, it is translated into English and the result is converted into synthetic speech. In-game events can drive other speech outcomes. For example, a bounty kill triggers a Chuck Norris API joke retrieval and the result is converted into synthetic speech.
This is held in a local memory queue exposed via REST endpoint whereby an HTML5 player will poll and playback in the background.
This video showcases the HTML5 player element. For demonstration purposes, the text is manually submitted via Postman to the text-to-speech local API endpoint. A variety of voices are used to show the range available:This video showcases in in-game experience for NPC and player text - including translation of German to English. If you want to see other examples (such as the Chuck Norris jokes upon bounty kill) please check out the playlist on YouTube: URL to all text-to-speech videos playlist
- Two voices are used for the synthesis
- Pitch, tone and emphasis are changeable from defaults in a manual fashion
- All text events create speech API calls even if seen before
In order of preference:
- Caching mechanism for already converted text
- Automatic variance of voice used
- Automatic mapping of voice to sources of text
- TTS project update #1 - adding texture to my generated speech
- A guide for using PowerShell with the Google Cloud Text-to-Speech API
- Combining Google Cloud Text to Speech and translation services
- Translating player chat
Whilst I’ve used this project to improve my knowledge in certain areas, I’ve found the following similar efforts along the way. They’re an inspiration in many ways. Do check them out: