SHOW:
|
|
- or go back to the newest paste.
| 1 | eng2audio() {
| |
| 2 | # this function gets the mp3 version of one given string from google translate | |
| 3 | # reference: http://stackoverflow.com/questions/9163988/download-mp3-from-google-translate-text-to-speech | |
| 4 | - | FILENAME="${*:?Usage: Please, give me words to translate}"
|
| 4 | + | FILENAME="${*:?Usage: Give me words to translate}"
|
| 5 | - | ! ping -n -c 4 -i 0.2 -W1 www.google.com > /dev/null && echo 'Connection error!' || \ |
| 5 | + | ! ping -n -c 4 -i 0.2 -W1 www.google.com > /dev/null && echo 'erro de conexão' || \ |
| 6 | wget -q -U Mozilla -O "${FILENAME// /_}.mp3" "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=$FILENAME"
| |
| 7 | } |