Debian Codegraph @

speech.sh

raw symbols SCIP
1 #!/bin/bash
2 # Courtesy of:
3 # http://elinux.org/RPi_Text_to_Speech_(Speech_Synthesis)
4
5 # You must be on-line for this script to work,
6 #+ so you can access the Google translation server.
7 # Of course, mplayer must be present on your computer.
8
9 speak()
10 {
11 local IFS=+
12 # Invoke mplayer, then connect to Google translation server.
13 /usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols \
14 "http://translate.google.com/translate_tts?tl=en&q="$*""
15 # Google translates, but can also speak.
16 }
17
18 LINES=4
19
20 spk=$(tail -$LINES $0) # Tail end of same script!
21 speak "$spk"
22 exit
23 # Browns. Nice talking to you.