Speech to Text Error in speak_text.py file

stt

#1

https://www.dexterindustries.com/howto/make-your-raspberry-pi-speak/

There is something wrong with the speak_text.py file.

It doesn’t work. It merely takes in the input and prints the output.
It does not speak. The speak_count.py file works perfectly. I suspect its something wrong with cmd-end or cmd_out. If someone could fix this that’d be great. I’m still trying to figure it out


#2

Hi @amkhan,

Here is my version of speak_text.py and speak_count.py that fix the problems, allow use without sudo, provide greater protection from quotes and apostrophes, and enables using espeak options to set speed and voice.

I made a speak.py module to generalize using TTS in my robot code as:

import speak

text = "I am a vociferous talker, but I can't hear myself speaking"
speak.say( text )

#3

Hello @amkhan

What type of tests have you done so far?
Have you tried :
aplay /usr/share/sounds/alsa/* to see if you can hear anything from the speaker?

And does this work?
espeak "Hello World"

Cleo