Conversation
|
Seconded. Also, options to increase/decrease the speed of TTS narration would be great if possible, since the default speed is slower than most people speak 🙂 |
you got it |
notimaginative
left a comment
There was a problem hiding this comment.
I tested it on Mac and confirmed everything was still working. Apart from the issues noted obviously. I'd like to check and test the Linux changes as well and will do that when I have a bit more time.
However, one desperately needed addition is the ability to actually test the voice changes before saving them.
| static SCP_vector<SCP_string> cached_voices; | ||
| static bool voices_cached = false; |
There was a problem hiding this comment.
This really doesn't need to happen. It's a complete waste of memory. The voices should be cached of course, but that should happen when and where it's needed, not globally at startup.
I'm only marking that issue here, but it applies to win and linux versions as well.
| // 180 wpm = normal | ||
| float rate = 180.0f * (rate_percent / 100.0f); |
There was a problem hiding this comment.
The base speaking rate varies by the voice in use so you can't use a general default value and have it sound right. I recommend using something similar to the attached diff which gets the default voice rate when a voice is set and uses that as the value for these calculations.
This applies to the Mac voice stuff only, but the Linux and Windows versions may need something similar, along with the value cap for safety.
|
Regarding testing; The options UI framework doesn't really have a nice way to set that up as a separate control. I'd recommend carving out a special case for this option's selector to play a test whenever the value changes. |
The objectives of this pr are:
Add TTS Speech options to ingame options settings. Incliding voice selection, voice rate, volume settings and select places were TTS is used
Add TTS Speech support to Linux OS by using speech-dispatcher/libspeechd-dev, this is done used dlopen and a small implementation of the lib types. In this way there is not additional dependency for compiling or in runtime, if speech-dispatcher is not installed on host OS, the speech system just fails to init.
Separate the speech system cpps into diferent files for each platform, copying the way it was done for mac, this is clearer and will make it easier to add other platforms, like android in the future.
Sanitize text was moved to an earlier stage, to fsspeech.cpp, to avoid having to repeat this bit of code in every implementation.
Note:
I may have broken mac tts with these changes and i have no way to test it.