1 | #!/bin/bash |
---|
2 | # Shell wrapper for Open JTalk. |
---|
3 | |
---|
4 | VOICE_DIR=@voice_dir@ |
---|
5 | DIC_DIR=@dic_dir@ |
---|
6 | |
---|
7 | CMDNAME=`basename $0` |
---|
8 | |
---|
9 | case $1 in |
---|
10 | -h) echo "Usage: $CMDNAME [-h] [-i infile]" 1>&2 ; exit 0 ;; |
---|
11 | -i) shift ;; |
---|
12 | *) set -- /dev/stdin ;; |
---|
13 | esac |
---|
14 | |
---|
15 | WAVFILE="/tmp/$CMDNAME-$$.wav" |
---|
16 | |
---|
17 | while read LINE |
---|
18 | do |
---|
19 | echo $LINE | iconv -t EUC-JP | open_jtalk \ |
---|
20 | -td $VOICE_DIR/tree-dur.inf \ |
---|
21 | -tf $VOICE_DIR/tree-lf0.inf \ |
---|
22 | -tm $VOICE_DIR/tree-mgc.inf \ |
---|
23 | -md $VOICE_DIR/dur.pdf \ |
---|
24 | -mf $VOICE_DIR/lf0.pdf \ |
---|
25 | -mm $VOICE_DIR/mgc.pdf \ |
---|
26 | -df $VOICE_DIR/lf0.win1 \ |
---|
27 | -df $VOICE_DIR/lf0.win2 \ |
---|
28 | -df $VOICE_DIR/lf0.win3 \ |
---|
29 | -dm $VOICE_DIR/mgc.win1 \ |
---|
30 | -dm $VOICE_DIR/mgc.win2 \ |
---|
31 | -dm $VOICE_DIR/mgc.win3 \ |
---|
32 | -cf $VOICE_DIR/gv-lf0.pdf \ |
---|
33 | -cm $VOICE_DIR/gv-mgc.pdf \ |
---|
34 | -ef $VOICE_DIR/tree-gv-lf0.inf \ |
---|
35 | -em $VOICE_DIR/tree-gv-mgc.inf \ |
---|
36 | -k $VOICE_DIR/gv-switch.inf \ |
---|
37 | -x $DIC_DIR \ |
---|
38 | -ow $WAVFILE && afplay $WAVFILE |
---|
39 | done < "$1" |
---|
40 | |
---|
41 | rm -f $WAVFILE |
---|
42 | exit 0 |
---|