View difference between Paste ID: 0rpEcGju and 4u4Bu6aN
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-
[ -n "`ping -c 2 www.google.com  > /dev/null`" ] && echo "yes"  || echo 'error: Not Conneted' && sleep 3 && exit 1
4+
ping -c 2 www.google.com  > /dev/null || echo 'Error: not connected!' && \
5
wget -q -U Mozilla -O "$*.mp3" "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=$*"
6
}