Compile Pico TTS on Raspbian
To translate text into voice, a TTS software (Text-to-Speech) is required. Under Linux there are basically two free tools: CMU Flite and eSpeak.
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.
Of course, there are also cloud-based TTS solutions (for example Amazon Polly oder Google Cloud TTS) - but you should decide on your own whether you would like to go for such a solution.
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:
1deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
Afterwards, the source code is downloaded:
1$ apt-get update
2$ apt-get source libttspico-utils
Before compiling the software, ensure to install some tools:
1# apt-get install autoconf libtool help2man libpopt-dev debhelper
After this, move to the svox
folder and start compiling the software:
1$ cd svox-<TAB>
2$ 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 packages from which you will need to install some:
1# 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:
1# apt-get remove --purge autoconf libtool help2man libpopt-dev debhelper
2# apt-get autoremove --purge
Finally, after that installation text can be converted into WAV files by leveraging the pico2wave
command:
1$ pico2wave -l de-DE -w output.wav "Franz jagt im komplett verwahrlosten Taxi quer durch Bayern"