summaryrefslogtreecommitdiffstats
path: root/util/bin
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-09-02 17:53:45 +0200
committermakefu <github@syntax-fehler.de>2013-09-02 17:53:45 +0200
commit7eb79f6564f498163a670fb3bc503dfcaace0ab5 (patch)
tree07571a600890c94bf8c36c7d59e29ebd54b81b15 /util/bin
parentff8a17e1fdf40ce8c7b6479f18f0476d442a8797 (diff)
refactor naturalvoices
util/lib/naturalvoices/att.sh contains functions to grab and play att text-to-speech from the servers god/ivan/naturalvoices_cached.sh and util/lib/naturalvoices/att.sh are using the new lib
Diffstat (limited to 'util/bin')
-rwxr-xr-xutil/bin/naturalvoices.att20
1 files changed, 14 insertions, 6 deletions
diff --git a/util/bin/naturalvoices.att b/util/bin/naturalvoices.att
index 6085e511..a2fe457c 100755
--- a/util/bin/naturalvoices.att
+++ b/util/bin/naturalvoices.att
@@ -1,10 +1,18 @@
#!/bin/sh
+cd $(dirname $(readlink -f $0))
+
+. ../lib/naturalvoices/att.sh
+
+: ${1?please provide \$1 as text}
+
text=$(echo $* | sed 's/ /+/g')
-voice="klara"
-base_url="http://192.20.225.36"
+voice="reiner"
+
+OUTFILE=`mktemp`
+trap "rm $OUTFILE" TERM INT EXIT
+
+get_tts "$text"
+
+play_file "$OUTFILE"
-TMPFILE=`mktemp`
-trap "rm $TMPFILE" TERM INT EXIT
- wget $base_url$( curl -Ss -H 'Host:192.20.225.36' -H 'Origin:http://www2.research.att.com' -e "http://www2.research.att.com/~ttsweb/tts/demo.php" -A "Mozilla/5.0 (X11; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0" -d "voice=$voice" -d "txt=$text" -d "speakButton=SPEAK" -H 'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' $base_url/tts/cgi-bin/nph-nvttsdemo | grep HREF|sed 's/.*\(".*"\).*/\1/' |sed -e 's/"//g' ) -O $TMPFILE
-aplay $TMPFILE