Create a gist now

Instantly share code, notes, and snippets.

@shokai /gsay
Created Jun 8, 2012

What would you like to do?
Mac/Linuxでsay(喋らせる)系コマンド
#!/bin/sh
TMP=/tmp/gsay.mp3
curl --silent --user-agent "Safari/1.0" "http://translate.google.com/translate_tts?q=$1&tl=ja" > $TMP && afplay $TMP && rm -f $TMP
#!/bin/sh
## sudo apt-get install mpg321
TMP=/tmp/gsay.mp3
curl --silent --user-agent "Safari/1.0" "http://translate.google.com/translate_tts?q=$1&tl=ja" > $TMP && mpg321 --quiet $TMP && rm -f $TMP
#!/bin/sh
TMP=/tmp/jsay.wav
#cd /usr/share/hts-voice/nitech-jp-atr503-m001
cd /usr/share/hts-voice/mei_happy
echo "$1" | open_jtalk \
-td tree-dur.inf \
-tf tree-lf0.inf \
-tm tree-mgc.inf \
-md dur.pdf \
-mf lf0.pdf \
-mm mgc.pdf \
-dm mgc.win1 \
-dm mgc.win2 \
-dm mgc.win3 \
-df lf0.win1 \
-df lf0.win2 \
-df lf0.win3 \
-dl lpf.win1 \
-ef tree-gv-lf0.inf \
-em tree-gv-mgc.inf \
-cf gv-lf0.pdf \
-cm gv-mgc.pdf \
-k gv-switch.inf \
-s 16000 \
-a 0.05 \
-u 0.0 \
-jm 1.0 \
-jf 1.0 \
-jl 1.0 \
-x /var/lib/mecab/dic/open-jtalk/naist-jdic \
-ow $TMP && \
aplay --quiet $TMP
rm -f $TMP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment