In the next article we are going to take a look at eSpeak NG. This is a multilingual, command line speech synthesizer software, in which we can use more than 100 languages. eSpeak NG is an updated version of the eSpeak engine created by Jonathan Duddington, and which we already talked about in a previous article in this same blog.
This program will read aloud the text that we provide. You can also grab the text either from standard input or from a file. The program uses text to speech to speak through the default sound device. This software can be helpful when listening to blogs, news sites, or in case we need to convert text to speech files for the visually impaired. eSpeak includes different voices and their characteristics can be modified as needed.
When using the program you will notice that speech can become quite clear, but no one expects something as natural or smooth as synthesizer voices based on human speech recordings. As I said above, eSpeak NG makes text-to-speech synthesis for more than 100 languages and accents, but apparently, some languages read better than others.
ESpeak NG General Features
- This is one cross-platform application that supports Gnu / Linux, Android, Mac OS and Windows.
- Is a free open source program, which was written in C.
- Includes different voices, whose characteristics can be modified.
- Can produce voice output as a WAV or mp3 file, instead of speaking directly. The resulting file can be played on any media player.
- also can translate text into phoneme codes, so it could be adapted as an interface for another speech synthesis engine.
- The program has potential for other languages. The languages you use are in different stages of progress. According to the creator, the help of native speakers of these or other languages is appreciated.
The source code of the eSpeak NG project is hosted on GitHub, like all its features in detail.
Install eSpeak NG on Ubuntu
We can find this program packaged for different Gnu / Linux systems. In Ubuntu, Debian and their derivatives, we will only need to use APT in a terminal (Ctrl + Alt + T) as follows:
sudo apt install espeak-ng
A quick look at the program
eSpeak NG is fully compatible with its predecessor. What's more uses the same command line options as eSpeak, and adds some more functionality. Among them we can find the following:
A phrase out loud
We can instruct the program to read a sentence aloud:
espeak-ng "Esto es un lo que va a leer el programa"
In addition, the program can also read the contents of a file aloud:
espeak-ng -f archivo.txt
It will also give us the ability to read text input from standard input:
espeak-ng
To exit you only need to use the combination CTRL + C.
Save the output to a file
If you are interested save the output to an MP3 audio file, it is only necessary to use the -w option as follows:
espeak-ng -w audio.mp3 "espeak ng va a guardar esto en un archivo mp3"
In case you are interested a .wav file, in the previous command you would only have to change the extension of the output file.
Print the phonemes of a text
The following command will pronounce the word 'Ubuntu'and it will print the phonemes:
espeak-ng -x Ubuntu
List the supported voices
This program supports several different voices, and we will be able to list them all with the command:
espeak-ng --voices
All voices that speak a specific language can also be listed. If for example we want see the voices that speak Spanish (es), you just have to use the command:
espeak-ng --voices=es
Change voice
eSpeak NG will pronounce by default the given text using the English voice. If you want to use a different voice, run something like the following:
espeak-ng -v nombre_de_voz
Help
The ones we have just seen are just some of the possibilities of this program. For get detailed information on how to use eSpeak NG, it will only be necessary to write in the terminal (Ctrl + Alt + T):
espeak-ng --help
Or we can also consult the manual pages:
man espeak-ng
Uninstall eSpeak NG
If you would like to remove this program from your computer, in a terminal (Ctrl + Alt + T) you just have to execute:
sudo apt remove espeak-ng
If you are interested in having a graphical interface for this program, you can go to the page to download gespeaker. In it you can download the .deb file to install it.
It can know more about this project at your GitHub repository.
It's good that there is something for our distro, although the voice is shit.