SVOX pico2wave
A very minimalistic TTS, a better sounding than espeak or mbrola (to my mind). Some information here.
I don't understand why pico2wave is, compared to espeak or mbrola, rarely discussed. It's small, but sounds really good (natural). Without modification you'll hear a natural sounding female voice.
AND ... compared to Mbrola, it recognise Units and speaks it the right way!
For example:
- 2°C → two degrees
- 2m → two meters
- 2kg → two kilograms
After installation I use it in a script:
#!/bin/bash
pico2wave -w=/tmp/test.wav "$1"
aplay /tmp/test.wav
rm /tmp/test.wav
Then run it with the desired text:
<scriptname>.sh "hello world"
or read the contents of an entire file:
<scriptname>.sh "$(cat <filename>)"
That's all to have a lightweight, stable working TTS on Ubuntu.
user597291 here again (don't have an account). Figured out how to do it with a single keybinding.
You can use xclip to take the primary selected text (i.e. highlighted text), then pipe that into the clipboard.
From there use xsel to take the clipboard text and pipe that to espeak. I also recommend sanitizing newlines, otherwise espeak will only read the last paragraph.
Method 1 (separate file):
The way I do it, the keybinding calls a script that does all of this which looks like sh ~/.custom-scripts/play-selected-text
in the keyboard binding command.
The script looks like this.
#! /bin/bash
xclip -out -selection primary | xclip -in -selection clipboard
xsel --clipboard | tr "\n" " " | espeak
Method 2 (directly in keybind):
If you don't need a separate folder for custom scripts, you can just put this into the keyboard binding command section.
xclip -out -selection primary | xclip -in -selection clipboard; xsel --clipboard | tr "\n" " " | espeak
Best Answer
After some investigations, I found a way for that using command line. If Jovie is working correctly with espeak and libttspico-utils is installed.
on konsole type
and answer the default answer for each question. This will create a conf file in ~/.config/speech-dispatcher/speechd.conf
edit this file and uncomment the line containing "pico-generic"
Then edit the file ~/.kde/share/config/kttsdrc, and change the outputModule of your talker from espeak to pico-generic
Check that speech-dispatcher is in user mode, by checking the file /etc/defaults/speech-dispatcher it should say:
To be sure, restart the computer.
The first time I used TTS, I got an DBUS error message, but after it is working fine.
Hope it will help.