Created
October 26, 2012 19:01
-
-
Save caquino/3960738 to your computer and use it in GitHub Desktop.
Google TTS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
MESSAGE=${*} | |
LANGUAGE=pt | |
TTSURL="http://translate.google.com/translate_tts" | |
USERAGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20111114 Ubuntu/9.10 (karmic) Firefox/8.0.1" | |
curl -s -G \ | |
--user-agent "${USERAGENT}" \ | |
--data-urlencode "tl=${LANGUAGE}" \ | |
--data-urlencode "q=${PREFIXMESSAGE} ${MESSAGE}" \ | |
--header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \ | |
--header "Accept-Language: en-us,en;q=0.5" \ | |
--header "Accept-Encoding: gzip,deflate" \ | |
--header "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" \ | |
--header "Keep-Alive: 300" \ | |
--header "Connection: keep-alive" \ | |
${TTSURL} > $$.mp3 | |
echo "$$.mp3" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment