HowTo: Raspberry Pi – Install speech output with eSpeak

You can also use the Raspberry Pi with the “espeak” package to read texts – and even entire files – to you.

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


Safety instructions

I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.
https://www.nerdiy.de/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 make a purchase via this link, Nerdiy.de will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support Nerdiy.de in being able to offer other useful projects in the future. 🙂 


Requirements

Before you start with this article you should have prepared the RaspberryPi so that it is accessible via the network and controllable via SSH.

The following three articles describe what needs to be done to prepare the RaspberryPi:
RaspberryPi – setup for nerdiys!
RaspberryPi – The first configuration!
RaspberryPi – Control the RaspberryPi via SSH

Required tool:
-no-

Required material:

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


Log in to the RaspberryPi via SSH

To start, you must first log in to the Rasp Pi with Putty via SSH. How to do this is in the article RaspberryPi - Control the RaspberryPi via SSH described.

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

Update package management

The package management in Linux is a "central place" through which various software packages can be installed. In order for this to work reliably, the lists and sources of the package management should be updated before each installation of new packages.

To start the update of the package management you have to enter the following command.
sudo apt-get update && sudo apt-get upgrade
Depending on how long ago your last update of the package management was, this process can now take a while. The lists that refer to the individual package sources are updated first.
After that, the packages themselves are updated. Since additional memory is occupied, you will be asked again for your consent. You have to confirm this with a "J" and "Enter".
Once the update is complete, you will see a small summary of the duration and scope of the update.

Install required package

In order for you to be able to use “espeak”, it must of course be installed first. To do this, execute the following command.
sudo apt-get install espeak
Confirm the request or note that the installation will take up additional memory with “Y” and “Enter”.

Start the first voice output

After the installation you can start right away. If you have connected a speaker, you must now enter the following command to activate the set “Hello Nerdiys, I’m a raspberry pi.” to spend.

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


Start voice output in German

To output in German, the parameter “-vde” must be added to the command. The “de” stands for German. All other languages can also be entered here. You can find a list of all available languages at: http://espeak.sourceforge.net/languages.html

Now to say “Hello Nerdiys, I am a Raspberry Pi.” To output it in German, enter the following command.
espeak -vde "Hi Nerdiys, I'm a Raspberry Pi."

Convert German terms into Denglish terms

Unfortunately, espeak does not automatically recognize whether it should pronounce words in German or English. In the sentence “Hello Nerdiys, I am a Raspberry Pi.” For example, “Pi” is pronounced in a very German way. Here you can use a trick: simply change “Pi” to “Pei” and the output sounds much better.

To output the English version you have to enter the following command.
espeak -vde "Hello Nerdiys, I am a Raspberry Pei."

Output current IP address

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

espeak "IP Address $(hostname -I)"
To get the current IP address of the RaspberryPi, just enter the command shown.

Have fun with the project

I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂

PS 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 think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂

Buy Me a Coffee at ko-fi.com       

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert

This site uses Akismet to reduce spam. Learn how your comment data is processed.