How to use qt-speech in Kubuntu 18.04 (cli / Okular)
In Kubuntu 18.04 Okular can read any selection text, or the whole document by default.
That is great, it is using qtspeech5
but
- How do I set the language?
- How can I use it from the CLI?
Can't find any setting in system-settings for speech.
Solution 1:
Okular
As for now (also in 19.04) Okular rely on libflite1 which supports only English via only one available qtspeech5-flite-plugin.
CLI
- There is
jovie
and in tray you can configure it and select language. You can use it from command line likeqdbus org.kde.kttsd "/KSpeech" say "Hello World." 0
.
Accessibility
- Another possibility is
orca
which is configured from: System Settings → Accessibility → Screen reader → Launch Orca Configurator.
CLI with Google's TTS (online)
Install with sudo apt install python-pip sox libsox-fmt-mp3
and then pip install gTTS
.
Usage: ~/.local/bin$ ./gtts-cli Hello\ World | play -t mp3 -