text to speech

I have a notebook with a broken display. I removed the display and want to use TTS instead. So on boot the machine can say things like “conected to Wifi SSID ….” and “my IP adress is …”

When I know the IP then I can connect via ssh or vnc. That might also be useful for Raspberry Pi. Another option can be a LCD connected via usb-to serial cable.

I found 3 solutions ; one for bash and one for python:

bash 1:
apt-get install libttspico-utils


A=`echo "hello world"` ; pico2wave --wave /tmp/Test.wav "$A" ; play /tmp/Test.wav; rm /tmp/Test.wav

bash 2:
apt-get install festival festvox-don


(echo "my IP adress is " ; hostname -I ) |festival --tts

python:

pip install pyttsx3

import pyttsx3;
engine = pyttsx3.init();
engine.say("hello world");
engine.runAndWait() ;

Leave a Reply