linux终端下的说话命令

把下面这些加入.bashrc中就可以了:(然后. .bashrc)


#say with espeak using english

#Usage: echo hello | sayee

alias sayee="espeak -s 120 -v en-us &> /dev/null"


#say with espeak using chinese

#Usage: echo 爱情 | sayec

alias sayec="espeak -v zh &> /dev/null"


#say with spd-say using english

#Usage: echo hello | sayse

alias sayse="spd-say -e -p -30 -l en -t female2 -r -30 &> /dev/null"


#say with spd-say using chinese

#Usage: echo 爱情 | saysc

alias saysc="spd-say -e -p -30 -l zh -t female2 -r -30>/dev/null"


#say with mplayer using english

#Usage: sayme "hello leptune"

#注意:该命令需联网,而且跟网速有关。网速太慢或词语过短都可能造成无法发音

function sayme

{

    mplayer -really-quiet "http://translate.google.com/translate_tts?ie=utf8&tl=en&q=$1" &> /dev/null

}


#say with mplayer using chinese

#Usage: saymc "爱情的海王星"

#注意:该命令需联网,而且跟网速有关。网速太慢或词语过短都可能造成无法发音

function saymc

{

    mplayer -really-quiet "http://translate.google.com/translate_tts?ie=utf8&tl=zh&q=$1" &> /dev/null


}



你可能感兴趣的:(linux)