Install and Use eSpeak on Ubuntu 20.04
For Linux, Windows, and other platforms, eSpeak is a software speech synthesizer that’s compact and open-source. You can generate text-to-speech audio files with this program. The program utilizes the formant synthesis method, enabling it to support a large number of languages. The languages of eSpeakNG are programmed primarily through rule files and feedback from native speakers. These are useful for a variety of purposes, including creating customizable Turing tests (Captchas) that can speak to their challenges.
In this article, we will look at how to install eSpeak and create a simple TTS audio file from a text document using Ubuntu 20.04.
So let’s get start,
Prerequisites
- A fresh Ubuntu 20.04 VPS on the VPSie Cloud Platform.
- Configure a root password on your server.
Step 1: Set up a VPSie cloud server
Start by logging into your VPSie account Make a new server, with at least 2 GB of RAM in the operating system (Ubuntu 20.04). Use the credentials that we emailed you to connect to your Cloud Server via SSH.
As soon as you are logged into Ubuntu 18.04, type the following command to install the latest packages onto your base system.
# apt-get update && apt-get upgrade -y
Step 2: Install eSpeak
All major Linux distributions include this tool by default. Simply run the following command to install it,
apt-get install espeak -y
Follow the command below to ensure eSpeak is installed properly,
espeak --version
This is the output you should receive,
# espeak --version eSpeak text-to-speech: 1.48.03 04.Mar.14 Data at: /usr/lib/x86_64-linux-gnu/espeak-data
Step 3: Generating audio files with eSpeak
Here let’s speak the line “Hello vpsie user Welcome to eSpeak” and record it to the test.mp4 audio file,
# espeak "Hello vpsie user Welcome to eSpeak" -w test.mp4 -g 60 -p 70 -s 100 -v en-us
Any audio player will now be able to play test.mp4. In addition, it is possible to specify a text file that you want to record in MP4 format.
Firstly, create a sample file called speak.txt,
nano speak.txt
Add the following content in the created text file:
VPSie is a feature-rich, powerful, and resilient cloud computing platform. It is designed with full automation features. VPSie’s solutions are designed for today’s computing demands with a key focus on modern design, security, reliability, scalability, recoverability, and manageability.
When you have finished with the file, save and close it. Afterward, execute the following command to convert speak.txt into a mp3 called speaktest.mp3,
espeak -f speak.txt -w speaktest.mp3 -g 60 -p 70 -s 100 -v en-us
Step 4: Install Gspeaker
This GUI interface for eSpeak is called Gespeaker. With it, text-to-speech functions can be managed. It can be installed using the command,
apt-get install gespeaker -y
As soon as it is installed, it can be launched through the Unity search bar. It looks like this,
The “Insert text to play” bar now allows you to type any text you want to hear and click the Play button to hear it. The Record button will also allow you to save the recording to the audio file for future listening.
Thanks for reading! I hope it was informative for you!
Get the most out of learning with VPSie.com