Make Your Raspberry Pi Speak

Published

Introduction: 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!")

Share

Recommendations

  • Woodworking Contest

    Woodworking Contest
  • Oil Contest

    Oil Contest
  • Clocks Contest

    Clocks Contest
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

13 Comments

Same problem as shiyazt and chippy johnson

Any clues as to how to fix this? Please

1 reply

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

3 replies

Hi man, I wonder if you dealt with the problem?I just get the same issue as you.Need help!please~

Hi man, I wonder if you dealt with the problem?I just get the same issue as you.Need help!please~

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.

1 reply

I'm getting errors in the command line but adding "2> /dev/null" isn't working

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

1 reply

try espeak "Hello world"

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

Same problem as shiyazt and chippy johnson

Any clues as to how to fix this?

Thanks homie