From 67a7a6a6beeae2b36de38c4dd59d4895b6a188bc Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 5 Mar 2015 17:16:19 +0100 Subject: utils: normalize naming of google wrappers --- util/bin/google.text2speech | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 util/bin/google.text2speech (limited to 'util/bin/google.text2speech') diff --git a/util/bin/google.text2speech b/util/bin/google.text2speech new file mode 100755 index 00000000..061bb1c8 --- /dev/null +++ b/util/bin/google.text2speech @@ -0,0 +1,24 @@ +#!/bin/sh +set -euf + +TL=${TL:="en"} + +usage(){ + echo 'TL= can specifiy which language to use, default is "en"' + echo 'Example: TL="de" ./text2speech.google "whats up?" | mpv -' + exit 0 +} + +text2speech(){ + text=$* + url="http://translate.google.com/translate_tts?ie=UTF-8&tl=$TL" + + curl -A "Mozilla/5.0" -Ss "$url" --data-urlencode "q=$text" +} + +if [ $# -eq 0 ]; then + usage +fi + +text2speech $* + -- cgit v1.2.3