playing with google text to speach on the Rp4

playing with google text to speach on the Rp4. scripts I found use mplayer... big piece of code had a go with wget, resulted in script gst7


# Usage: # To speak a line of text: echo "any text" | ./gst7 # To record a line of text as mp3: echo "any text" | ./gst7 filename.mp3

read user_reply

if [ "$1" == "" ] then wget --user-agent seamonkey --no-check-certificate -O /dev/stdout "

formatting link
$user_reply&tl=en" | mpg123 - else wget --user-agent seamonkey --no-check-certificate -O $1 "
formatting link
$user_reply&tl=en" fi

OK, but what if I want to speak and record a complete text? script test1


# Usage: # ./test1 songtext.txt

# define language of text file, uncomment as required # GERMAM= #languahe=de

# ENGLISH language=en

# FRENCH #language=fr

# DUTCH #language=nl


# delete any old index file rm mp3_list.txt

let i=0 while IFS= read -r line do # show where we are echo "$line"

# one line of text to one mp3 file wget --user-agent seamonkey --no-check-certificate -O t$i.mp3 "

formatting link

# generate list of mp3 files one per line echo "file 't$i.mp3'" >> mp3_list.txt

let i=i+1

# pause between lines, leave this out if you want speed sleep 1 done < "$input"

# to playback all generated mp3 files in sequence: # let i=0 ; while [ 1 ] ; do mpg123 t$i.mp3 ; let i=i+1; sleep 1; done

# to combine mp3 files for playback # ffmpeg -f concat -safe 0 -i mp3_list.txt -c copy -y output.mp3

# to play everything # mpg123 output.mp3

Could do a whole book that way.

Reply to
Jan Panteltje
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.