diff options
Diffstat (limited to 'tools/voicecommon.sh')
-rw-r--r-- | tools/voicecommon.sh | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tools/voicecommon.sh b/tools/voicecommon.sh index 13df3e9739..138ff59a9e 100644 --- a/tools/voicecommon.sh +++ b/tools/voicecommon.sh | |||
@@ -46,8 +46,14 @@ SPEEX_BIN=speexenc | |||
46 | # The oggenc executable | 46 | # The oggenc executable |
47 | VORBIS_BIN=oggenc | 47 | VORBIS_BIN=oggenc |
48 | 48 | ||
49 | # Tools directory | ||
50 | TOOLSDIR=`dirname $0` | ||
51 | |||
49 | # The wavtrim executable | 52 | # The wavtrim executable |
50 | WAVTRIM=`dirname $0`/wavtrim | 53 | WAVTRIM=$TOOLSDIR/wavtrim |
54 | |||
55 | # The SAPI5 script directory | ||
56 | SAPI5DIR=`cygpath $TOOLSDIR -a -w` | ||
51 | 57 | ||
52 | ##################### | 58 | ##################### |
53 | # Festival settings # | 59 | # Festival settings # |
@@ -158,12 +164,20 @@ init_tts() { | |||
158 | fi | 164 | fi |
159 | ;; | 165 | ;; |
160 | espeak) | 166 | espeak) |
161 | # Check for flite | 167 | # Check for espeak |
162 | if [ ! `which $ESPEAK_BIN` ]; then | 168 | if [ ! `which $ESPEAK_BIN` ]; then |
163 | echo "Error: $ESPEAK_BIN not found" | 169 | echo "Error: $ESPEAK_BIN not found" |
164 | exit 5 | 170 | exit 5 |
165 | fi | 171 | fi |
166 | ;; | 172 | ;; |
173 | sapi5) | ||
174 | # Check for SAPI5 | ||
175 | cscript /B $SAPI5DIR/sapi5_init_tts.vbs | ||
176 | if [ $? -ne 0 ]; then | ||
177 | echo "Error: SAPI 5 not available" | ||
178 | exit 5 | ||
179 | fi | ||
180 | ;; | ||
167 | *) | 181 | *) |
168 | echo "Error: no valid TTS engine selected: $TTS_ENGINE" | 182 | echo "Error: no valid TTS engine selected: $TTS_ENGINE" |
169 | exit 2 | 183 | exit 2 |
@@ -268,6 +282,9 @@ voice() { | |||
268 | echo "Action: Generate $WAV_FILE with flite" | 282 | echo "Action: Generate $WAV_FILE with flite" |
269 | echo -E "$TO_SPEAK" | $FLITE_BIN $FLITE_OPTS -o "$WAV_FILE" | 283 | echo -E "$TO_SPEAK" | $FLITE_BIN $FLITE_OPTS -o "$WAV_FILE" |
270 | ;; | 284 | ;; |
285 | sapi5) | ||
286 | cscript /B "$SAPI5DIR\sapi5_voice.vbs" ""$TO_SPEAK"" "$WAV_FILE" | ||
287 | ;; | ||
271 | esac | 288 | esac |
272 | fi | 289 | fi |
273 | fi | 290 | fi |