Making a terminal speak a message on opening

We saw how we can have the terminal display a message when opened in the post "Making a message appear on opening a terminal"

What if we want to have the terminal greet us with a voice message.

One of the ways to do that is a text to speech converter, for e.g. the utility espeak converts what ever text is passed to it into speech.

To be able to use this command, install the package "espeak". For debian based systems run the command

Now open a terminal and type

and the word hello will be spoken by an automated voice.

To have the terminal speak a message every time it is opened we just have to use the espeak command in ~/.bashrc file .

For e.g. to be greeted with a message "Hello" on opening a terminal

1. Open the file ~/.bashrc

2. At the end of the file add

3. Save the chages, close the file as well as the terminal.

4. Now open a new terminal and the message "Hello" should be heard as soon as the terminal opens.

Follow by Email