HowTo: Raspberry Pi – Speech output with eSpeak

Thanks to the “espeak” package, you can also use the RaspberryPi to read out texts – and even entire files.

How to do that and what you have to keep in mind is described in this article

Hints for our lovely english readers: Basically, many of the articles on Nerdiy.de are translations from the original german articles. Therefore, it may happen here and there that some illustrations are not available in english and that some translations are weird/strange/full of mistakes or generally totaly wrong. So if you find some obvious (or also not obvious) mistakes don't hesitate to leave us a hint about that in the comment section. 
Also please don't get confused, that instead of a "dot" often a "comma" is used as decimal separator. 🙂


Safety instructions

I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance. https://www.nerdiy.de/en/sicherheitshinweise/

Affiliate links / advertising links

The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and shop via this link, Nerdiy.de receives a commission from the online shop or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support Nerdiy.de in being able to offer further useful projects in the future. 🙂


Requirements

Helpful Articles:

Before you start with this article, you should have prepared the RaspberryPi so far that it can be reached via the network and controlled by SSH.
RaspberryPi – Setting up for Nerdiys!
RaspberryPi – The first configuration
RaspberryPi – Controlling the RaspberryPi via SSH

Required tools:
-none-

Required material:

In the following list you will find all the parts you need to implement this article.


Log in via SSH on the RaspberryPi

To get started, you first need to log in to RasPi with SSH on Putty. How to do it is described in the article

After entering your username and password you can start to enter the first commands.

Update package management

The package management in Linux is a "central point" over which various software packages can be installed. For this to work reliably, the lists and sources of package management should be updated before installing any new packages.

To start the package management update you have to enter the following command.
sudo apt-get update && sudo apt-get upgrade
Depending on how long your last update of the package management is, this process can take some time. First, the lists are updated in which the individual repositories are referenced.
Then the packages themselves are updated. As this additional memory is occupied, you will again asked for your consent. You have to confirm this with a "J"(in German) or a "Y" and "Enter".
When the update is complete, you will see a small summary of the duration and scope of the update.

Install the required package

Of course, this must first be installed so that you can use “espeak”. Execute the following command.
sudo apt-get install espeak
Confirm the demand or note, that the installation occupies additional memory, with “J”(German) or “Y” and “Enter”.

Start the first voice output

After the installation, you can start right away. If you have a loudspeaker connected just enter the following command to let the RaspberryPi speak the sentence “Hello Nerdiys, I’m a raspberry pi.”.

espeak "Hello Nerdiys, I'm a raspberry pi."


Start voice output in German (or any other language)

To execute the output in German, the parameter “-vde” must be added to the command. Here the “de” stands for German. At this point all other languages can be entered. A list of all available languages can be found at: http://espeak.sourceforge.net/languages.html

To get the sentence “Hello Nerdiys, I’m a Raspberry Pi.” in German execute the following command.
espeak -vde "Hallo Nerdiys, ich bin ein Raspberry Pi."

Output current IP address

In this way you can also output the response of executed commands. For example, to output your IP address, simply enter the following command.

espeak "IP Adress $(hostname -I)"
To give you the current IP address of the RaspberryPi, simply enter the shown command.

I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂

Fab

P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate it that I share these information with you, I would be happy about a small donation to the coffee box. 🙂

Buy Me a Coffee at ko-fi.com

Leave a Reply

Your email address will not be published. Required fields are marked *