eSpeak is free and open-source software that can be used to convert text to voice in English and other languages. It can be installed on Windows and Linux-based operating systems. eSpeak takes input from the string or files and generates an audio format file. You can play this file using any player.
In this tutorial, we will show you how to install eSpeak on an Ubuntu 24.04 server. This procedure is compatible with Ubuntu 22.04 and Ubuntu 24.04.
Step 1 – Install eSpeak
By default, this tool is available in all major Linux distributions. You can install it by just running the following command:
apt-get install espeak -y
Once the installation is finished, verify the installed version of eSpeak with the following command:
espeak --version
You should get the following output:
eSpeak text-to-speech: 1.48.15 16.Apr.15 Data at: /usr/lib/x86_64-linux-gnu/espeak-data
Step 2 – Generate Audio File with eSpeak
Now, let’s speak the line “Hi Welcome to eSpeak” and record it to the file1.mp4 audio file:
espeak "Hi Welcome to eSpeak" -w file1.mp4 -g 60 -p 70 -s 100 -v en-us
You can now play the file1.mp4 using any audio player.
You can also specify the text file that you want to record in the mp4 format.
First, create a sample file named file.txt:
nano file.txt
Add the following contents:
Atlantic Cloud offers hosting solutions customized to your business needs including cloud, managed, dedicated, HIPAA compliant, and more.
Save and close the file when you are finished.
Next, run the following command to convert file.txt to the mp4 audio format file named file2.mp4:
espeak -f file.txt -w file2.mp4 -g 60 -p 70 -s 100 -v en-us
You can now download file1.mp4 and file2.mp4 to your desktop computer and play both file to test.
Conclusion
In the above guide, you learned how to install eSpeak on Ubuntu 24.04. You can now easily convert any text file into an audio file. Try it today on dedicated server hosting from Atlantic.Net!