Linux OSBN/Ubuntuusers Planet XING / LinkedIn / Amazon

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:

deb-src 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"

Sharing is caring

7 Comments Add New Comment

  1. Simon says:

    Hi Christian, this is exactly what I was looking for because I’m not happy with the results of espeak in Italian. Problem is I’m getting an error on the very first step of your recipie, when I run
    deb-src buster main contrib non-free rpi
    I get bash: deb-src: command not found
    I’m new to Pi/Linux and have no idea what to do to fix the error. I’d really appreciate if you can guide me on that.
    Many thanks in advance

  2. Simon says:

    Christian, please disregard my preivous comment. I found what I was doing wrong by asking to Mr. Google (I should have done that before posting the remark).

    Anyway many thanks for the article, I have everything running!


  3. maldex says:

    in one go

    cd /usr/local/src
    sudo sed -i ‘s/^#deb-src/deb-src/g’ /etc/apt/sources.list
    sudo apt-get update
    sudo apt-get install -y autoconf libtool help2man libpopt-dev debhelper

    sudo rm -rf svox*
    sudo apt-get source libttspico-utils

    cd svox-1.0*/

    time sudo dpkg-buildpackage -rfakeroot -us -uc

    cd ..

    sudo dpkg -i libttspico-data_*all.deb libttspico-utils*.deb libttspico0*.deb

    cd ~

    pico2wave -w ~/test.wav -l de-DE “Franz jagt im komplett verwahrlosten Taxi quer durch Zürich” && aplay ~/test.wav

Leave a Reply

Your email address will not be published. Required fields are marked *