From 9cceedcca2033f5b9489c6cd86fa6741e8aca67b Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Mon, 27 Feb 2012 08:56:06 +0100 Subject: [PATCH] Corrected crashing bug in TTS --- Config.praat | 2 +- InitialiseSGC2.praat | 12 ++++++------ praat_module/makePraat.sh | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Config.praat b/Config.praat index 13d656f..8032a04 100644 --- a/Config.praat +++ b/Config.praat @@ -129,7 +129,7 @@ endproc procedure processConfigSynthesis .tts$ .clickX .clickY .pressed$ .table$ = "Config" .label$ = "Synthesis_'.tts$'" - if sgc.synthesizer > 0 or (speakCommandFile$ <> "" and fileReadable(speakCommandFile$)) + if sgc2.synthesizer > 0 or (speakCommandFile$ <> "" and fileReadable(speakCommandFile$)) if config.synthesis$ = "" config.synthesis$ = .tts$ .displayButton = 2 diff --git a/InitialiseSGC2.praat b/InitialiseSGC2.praat index 784e7db..bea24d8 100644 --- a/InitialiseSGC2.praat +++ b/InitialiseSGC2.praat @@ -304,7 +304,7 @@ endproc # speakCommandDir$ = "'preferencesAppDir$'/TTS" # speakCommandFile$ = "" procedure set_up_TTS - sgc.synthesizer = Create SpeechSynthesizer... Mandarin m1 44100 0.01 50 100 100 yes no + sgc2.synthesizer = Create SpeechSynthesizer... Mandarin m1 44100 0.01 50 100 100 yes no if macintosh .ttscommand$ = "speak" @@ -350,7 +350,7 @@ procedure set_up_TTS .command_path$ = replace$(.command_path$, "'newline$'", "", 0) # Command path found - if .command_path$ <> "" and fileReadable(.command_path$) + if sgc2.synthesizer <= 0 and .command_path$ <> "" and fileReadable(.command_path$) deleteFile("'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt") fileappend "'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt" ...'.quote$''.ttscommand$''.quote$' -v zh+f4 -s 100 'newline$' @@ -364,7 +364,7 @@ procedure set_up_TTS endif # Close off (other TTS maybe a later option) - if sgc.synthesizer > 0 or (speakCommandFile$ <> "" and fileReadable(speakCommandFile$)) + if sgc2.synthesizer > 0 or (speakCommandFile$ <> "" and fileReadable(speakCommandFile$)) config.synthesis$ = "eSpeak" endif endproc @@ -510,7 +510,7 @@ endproc # TTS synthesis procedure synthesize_sound .pinyin$ .command$ = "" - if fileReadable(speakCommandFile$) + if speakCommandFile$ <> "" and fileReadable(speakCommandFile$) .command$ < 'speakCommandFile$' .command$ = replace$(.command$, "'newline$'", " ", 0) if macintosh @@ -520,8 +520,8 @@ procedure synthesize_sound .pinyin$ elsif windows system_nocheck call '.command$' "'.pinyin$'"' endif - elsif sgc.synthesizer > 0 - select sgc.synthesizer + elsif sgc2.synthesizer > 0 + select sgc2.synthesizer Play text... '.pinyin$' endif endproc diff --git a/praat_module/makePraat.sh b/praat_module/makePraat.sh index 4cdf112..24a5cc4 100755 --- a/praat_module/makePraat.sh +++ b/praat_module/makePraat.sh @@ -52,6 +52,8 @@ if [[ ${1:-Normal} == "MinGW" && ${2:-Normal} == "XP" ]]; then else ln -s ${CURRENTWORKINGDIR}/${APPLICATIONNAME}expanded.h ./demopraatapplication.h fi +# Create a file containing the Build number +grep 'build_SHA$ = "' ${CURRENTWORKINGDIR}/${APPLICATIONNAME}expanded.praat | grep ':' | perl -ane '/\"([A-F0-9]+)\s+([\d\-]+)(.*)\"/;print "$1 $2$3\n";' > ${CURRENTWORKINGDIR}/Build_SHA.html # Get the manual into the tutorials manual cp ../fon/manual_tutorials.cpp ../fon/manual_tutorials.cppORIGINAL -- 2.11.4.GIT