instead of reading massively long passages of text (which can become tiresome fast)

it might be nice, to have the computer read out that text?

let’s do that 🙂

click play to hear picotts read above text:

multiple choices

there are different Open Source text2speech systems, programs out there…

multi language talent: pico tts

(no not the text editor)

  • supported languages:
    • English, US (en-US) / English, GB (en-GB)
    • Spanish (es-ES)
    • French (fr-FR)
    • German (de-DE)
    • Italian (it-IT)

The Pico service produces audio streams using WAV containers and PCM (signed) codec with 16bit depth.

“The Pico Text-to-Speech (TTS) service uses the TTS binary from SVOX for producing spoken text.”

“You manually need to install the pico2wave binary in order for this service to work correctly. You can, e.g., install it with apt-get on an Ubuntu system” (src)

show me the src: https://github.com/naggety/picotts

lsb_release -a; # tested on
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

# if not already, install the genious mplayer & ffmpeg packages :)
# (or some other player that can play wav files)
su - root
apt update
apt install mplayer ffmpeg

# this is (unfortunatley) only in the non-free repo
https://packages.debian.org/buster/libttspico0
# pre compiled package (not the latest, but might just do the job)
apt search libttspico-utils
apt install libttspico-utils
libttspico-utils/stable,stable 1.0+git20130326-11 amd64
  Small Footprint TTS (binaries)

# compile from src
# make new dir where to store the software
# as non-root user
mkdir -P /software/pico/
cd /software/pico/
git clone https://github.com/naggety/picotts.git

# now change to root
su - root
apt update; apt install autoconf libtool help2man libpopt-dev debhelper;
Ctrl+D # log off root
./autogen.sh
./configure 
make

su - root
cd /software/pico/picotts/pico
make install

Ctrl+D # log off root
# try running it
pico2wave
Mandatory option: --wave=filename.wav

Usage: pico2wave 
  -w, --wave=filename.wav     Write output to this WAV file (extension SHOULD be .wav)
  -l, --lang=lang             Language (default: "en-US")

Help options:
  -?, --help                  Show this help message
      --usage                 Display brief usage message

# if error "libttspico.so.0" not found
ln -sv /software/pico/picotts/pico/.libs/libttspico.so.0 /usr/lib/libttspico.so.0
# or copy that file libttspico.so.0 into /usr/lib

# remove packages (not needed anymore)
apt-get remove --purge autoconf libtool help2man libpopt-dev debhelper;
apt-get autoremove --purge;

how to let it read text, usage example:

copy and paste the text the user wants to have read out loud into a file called read.txt

# for US-English
cat read.txt| pico2wave -l en-US -w ./read.text.wav; mplayer ./read.text.wav;rm -rf ./read.text.wav;

# for UK-English
cat read.txt| pico2wave -l en-GB -w ./read.text.wav; mplayer ./read.text.wav;rm -rf ./read.text.wav;

# for Spanish
cat read.txt| pico2wave -l es-ES -w ./read.text.wav; mplayer ./read.text.wav;rm -rf ./read.text.wav;

# for French
cat read.txt| pico2wave -l fr-FR -w ./read.text.wav; mplayer ./read.text.wav;rm -rf ./read.text.wav;

# for German
cat read.txt| pico2wave -l de-DE -w ./read.text.wav; mplayer ./read.text.wav;rm -rf ./read.text.wav;

# for Italian
cat read.txt| pico2wave -l it-IT -w ./read.text.wav; mplayer ./read.text.wav;rm -rf ./read.text.wav;

script it 🙂

usage example of the script:

/path/to/script.sh text2read.txt lang

/scripts/read.sh read.txt en
# create the script
vim /scripts/read.sh

#!/bin/bash

echo "... converting text $1 to computer spoken audio"

if [ "$2" = "en" ];
then
	# for US-English
	cat $1 | pico2wave -l en-US -w ./read.text.wav;
fi

if [ "$2" = "uk" ];
then
	# for UK-English
	cat $1 | pico2wave -l en-GB -w ./read.text.wav;
fi

if [ "$2" = "es" ];
then
	# for Spanish
	cat $1 | pico2wave -l es-ES -w ./read.text.wav;
fi

if [ "$2" = "fr" ];
then
	# for French
	cat $1 | pico2wave -l fr-FR -w ./read.text.wav;
fi

if [ "$2" = "de" ];
then
	# for German
	cat $1 | pico2wave -l de-DE -w ./read.text.wav;
fi

if [ "$2" = "it" ];
then
	# for Italian
	cat $1 | pico2wave -l it-IT -w ./read.text.wav;
fi

echo "... starting playback"
mplayer ./read.text.wav;

echo "... removing temporary wav file"
rm -rf ./read.text.wav;

english only but with accents: flite

flite supports only english (?) but that even in DIFFERENT ACCENTS! X-D

su - root
apt update; apt install flite;
flite/stable,now 2.2-2 amd64 [installed]
  Small run-time speech synthesis engine

# get more english language accents
wget -r --no-parent --no-directories --accept flitevox http://www.festvox.org/flite/packed/flite-2.0/voices/

# usage example
cat speak.txt | flite -voice /path/to/flite/voices/cmu_us_awb.flitevox

Links:

creditz: https://cstan.io/?p=11840&lang=en

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin