Introduction: Make Your Raspberry Pi Speak

Picture of Make Your Raspberry Pi Speak

A simple method to get some feedback from the Raspberry Pi is to use Text To Speech (TTS).

I this Instructable I will show you how to do this using Python and Espeak.

Parts required:

-Raspberry Pi with internet connection (internet just for setup)

-Speaker

Step 1: Install Python

If you haven't installed Python already, install it via apt-get:

sudo apt-get install python-dev

Step 2: Install Espeak

To install the TTS engine (Espeak) and the Python module, use the following command:

sudo apt-get install espeak
sudo apt-get install espeak python-espeak

Step 3: Speak!

To speak a sentence, use the command

espeak Hello Instructables!

or in Python:

from espeak import espeak

espeak.synth("Hello Instructables!")

Comments

glenntref (author)2016-12-29

I got rid of the errors by entering "start-pulseaudio-x11" prior to using espeach

Kravex (author)2016-10-18

Any ideas why it only says one word no matter how many there are?

vor0nwe (author)2016-09-16

I also get the errors when using the command-line, but the text is spoken correctly. So I just add " 2> /dev/null" to the command to send the error messages to the bitbucket.

Also, in my experience flite (festival lite) produces nicer spoken text, but it supports less languages.

RottenSod (author)2016-09-16

Same problem as shiyazt and chippy johnson

Any clues as to how to fix this?

shiyazt (author)2016-01-14

One issue:

when i use this command espeak Hello Instructables!

I AM GETTING THIS ERRORS ! PLZ HELP

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM front

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround40.0:CARD=0'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround40

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround41

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround50

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround51

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround71.0:CARD=0'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround71

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM iec958

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'

ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

Cannot connect to server socket err = No such file or directory

Cannot connect to server request channel

jack server is not running or cannot be started

chippy johnson (author)shiyazt2016-09-13

same here.........

skivi made it! (author)2016-01-23

Nice idea, I especially like the python implementation, you can make your Pi for example measure something and then say it out loud. I received lots of errors, but apparently those don't mean it's not working...

IvorS (author)2015-07-20

Thanks homie