espeak is linux text to speech synthesizer utility in english (and several other languages).
It convert text to speech from command line or the file.
Espeak also can be tuned with various configurable parameters like language of
voice, pitch of voice, words per minute rate etc.
In this article we explore espeak command.
Later we shall finally write sample startup script that will greet you based on the time of the day.
You May Like
On debian based system (Ubuntu)
sudo apt-get update
sudo apt-get install espeak
For fedora based system
sudo dnf install espeak
Espeak : speak words specified in command line
espeak "I love Linux"
To show summary of options
--voices : list out available voices. Use -v <voice> option to use particular voice
#speak hindi dilect
espeak -v hi "नमस्ते"
-f [fileName] :To read out file
espeak -f /home/savan/readFromFile.txt
Increase or decrease number of spoken words per minute. Default is 160.
espeak -f story.txt -s 140
To write output into audio format rather than to speaker
espeak -v hi "नमस्ते" -w /tmp/file.wav
You can play this file with audio player like vlc
Writing startup greetings script
Let’s use espeak command to write script that will greet you based on time of the day every time you login your computer.
Copy the contents below to file named greetings.sh in your home folder
/home/savan/greetings.sh file content:
if [ $h -lt 12 ]; then
espeak -v en "Good morning Savan."
elif [ $h -lt 18 ]; then
espeak -v en "Good afternoon Savan."
espeak -v en "Good Evening Savan."
Make this file executable
chmod 777 /home/savan/greetings.txt
Open searchbox and open "Startup Applications"
Click "Add" button
Add following details
Name : Login Greeting
Command : sh /home/savan/greetings.sh
Comment: Greets on login
Save it! Next time upon login, you will hear greetings based on time of the day. You can customize it more according to your preference!
So that was it in this short article. Linux OS is fun to play with. Comment your issues or suggestions etc
in section below.
These commands on linux helps you to customize the desktop environment accroding to your preference.
If you liked this article, share with your friends. Subscribe to blog posts.
Comment down in section below.
That's all for now. Do leave suggestions, comments or questions in the comment section below.