In this thread: Slightly ridiculous but working setup for ally chat TTS on Linux with different voices for different players.
This uses Larynx, the free TTS system with which I've had best results so far, but it should work with any system that supports SSML and streaming I/O.
1. Install
Larynx in one of the ways described there.
2. Install
this widget as usual. All it does is to write chat messages to the file /path/to/zero-k/text_to_speech.ssml, with SSML <voice> tags to select different voices. The voice is determined by the player's Lobby ID (thx
![unknown](/img/flags/unknown.png)
![rank](/img/ranks/7_6.png)
Shaman) modulo the number of voices, so the voice assignment will be persistent unless you add/remove voices.
3. Start playing or specing a match with the widget enabled so the file gets created.
4. Run this in a terminal (after adjusting the path to Zero-K):
tail -f /path/to/zero-k/text_to_speech.ssml -n1 | tee >(larynx --stdin-format=lines --interactive --play-command 'play -v 0.2 -' --ssml)
Larynx will automatically download each voice the first time it's used (they're pretty big, about 220 MB each).
The "-v 0.2" is the volume, from 0 to 1.
It will continue running independently of ZK until you Ctrl+C it.
Optional: Voice configuration
Voice samples are available
here; you can also get a list by running `larynx --list`. Just add the names of the ones you like to the "voices" array near the top of the widget.
Possible future improvement: Turn common acronyms like "aa" into uppercase so Larynx spells them out instead of just making an "ah" sound.
Why couldn't I use/extend the existing TTS widget: It forwards a message to
Chobby, which invokes the `spd-say` program from speech-dispatcher, but unfortunately, at that point the player information is already lost, and I can't readily modify Chobby. Additionally, I didn't find a Larynx backend for speech-dispatcher, though you could just put your own fake `spd-say` command on the path I suppose.