2013-05-24 22:14:09 +00:00
|
|
|
# this is notes for video: http://www.youtube.com/watch?v=UhVKuAozSMc
|
|
|
|
|
2013-03-28 19:16:55 +00:00
|
|
|
say() {
|
|
|
|
# limit to 100 character or less
|
|
|
|
# language code: http://developers.google.com/translate/v2/using_rest#language-params
|
|
|
|
# useage: say <language code> <phase>
|
|
|
|
# example: say es come with me
|
|
|
|
mplayer -user-agent Mozilla \
|
|
|
|
"http://translate.google.com/translate_tts?ie=UTF-8&tl="$1"&q=$(echo "$@" \
|
|
|
|
| cut -d ' ' -f2- | sed 's/ /\+/g')" > /dev/null 2>&1 ;}
|
|
|
|
|
|
|
|
say-translation() {
|
|
|
|
# by: gotbletu
|
|
|
|
# requires: http://www.soimort.org/google-translate-cli/
|
|
|
|
# limit to 100 character or less
|
|
|
|
# language code: http://developers.google.com/translate/v2/using_rest#language-params
|
|
|
|
# useage: say-translation <language code> <phase>
|
|
|
|
# example: say-translation es come with me
|
|
|
|
lang=$1
|
|
|
|
trans=$(translate {=$lang} "$(echo "$@" | cut -d ' ' -f2- | sed 's/ /\+/g')" )
|
|
|
|
echo $trans
|
|
|
|
mplayer -user-agent Mozilla \
|
|
|
|
"http://translate.google.com/translate_tts?ie=UTF-8&tl=$lang&q=$trans" > /dev/null 2>&1 ;}
|