Make your teminal greet you with a Voice Note!

Wouldn’t it be cool if you could make your terminal greet you with a custom voice note every time you opened it. The “espeak” package makes it possible.

Fedora:
It comes pre-installed in Fedora. Check using the following command:

$ espeak – -version

eSpeak text-to-speech: 1.48.03 04.Mar.14 Data at: /usr/share/espeak-data

If you get a similar output then it is already installed.

Ubuntu:

It can be easily installed in Ubuntu by just firing this single command:

$ sudo apt-get install espeak

Espeak is a powerful package that can read lines from a file and recite them. It can even read from the stdin. Moreover you can adjust the sentence speed, pitch and amplitude of the voice along with choosing a male or a female voice.

Espeak and some of its usages:

  • espeak -f <file.txt> : Read from the given file
  • espeak –stdin : Read whatever input is given from keyboard
  • espeak -s <words per minute>: Change the speed of sentence from default to given words per minute
  • espeak -p <value>: Changes pitch of the sound from the default 50 to specified value where 0 < value < 99
  • espeak -w output.wav “New audio file” – To create a WAV file instead of speakingsomething.

Actual Work:

Now, to make your terminal greet you with a voice note, follow these steps.
Open the bashrc file in your home directory:

$ vi ~/.bashrc

Add the following command to the end of the file:

echo “Welcome Rishika” | espeak -s 160

After you save and exit the file(Esc :wq), reopen the terminal and hear your terminal welcoming you.
You can place any message in palce of “Welcome Rishika”. And every time you fire up your terminal it’ll greet you with that voice note.

Hope you liked this blog, please leave a comment below if you have some other cool ideas to implement using the espeak package.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s