CMU Flite (festival-lite) exists since 2001 and is therefore considered a veteran in speech synthesis under Linux, eSpeak was first released in 2006. From a sound perspective, both tools deliver usable results when using english language, the german voices could be improved heavily.
And there is Pico TTS – a software from the Android project that works offline and – at least of for the german language – sounds way better than eSpeak and Flite. Under Debian, the appropriate packages are part of the non-free channel – for Raspbian there are no pre-compiled packages.
For manually compiling the software, the APT source list (/etc/apt/sources.list) needs to be altered in order to include source code packages:
deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
Afterwards, the source code is downloaded:
$ apt-get update $ apt-get source libttspico-utils
Before compiling the software, ensure to install some tools:
# apt-get install autoconf libtool help2man libpopt-dev debhelper
After this, move to the svox folder and start compiling the software:
$ cd svox-<TAB> $ dpkg-buildpackage -rfakeroot -us -uc
Create the packages takes at about 2 minutes on a Raspberry Pi 4, the older Pi 3 needs at about 4,5 minutes.
Move to the previous folder, you will find multiple DEB pakages from which you will need to install some:
# dpkg -i libttspico-data_*all.deb libttspico-utils*.deb libttspico0*.deb
Afterwards you can remove the tools required for compiling the software if you want to save some space:
# apt-get remove --purge autoconf libtool help2man libpopt-dev debhelper # apt-get autoremove --purge
Finally, after that installation text can be converted into WAV files by leveraging the pico2wave command:
$ pico2wave -l de-DE -w output.wav "Franz jagt im komplett verwahrlosten Taxi quer durch Bayern"