summaryrefslogtreecommitdiffstats
path: root/pico
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2009-07-15 16:44:38 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2009-07-15 16:44:38 -0700
commit0253f57b5d2454e31906bcfdfa9168587ecbef42 (patch)
treecb5297a25d224fc81cf3cc52ebabff623efeb9d9 /pico
parent498b2c1776cdc2324e6792ad564c6ff3b589298f (diff)
downloadexternal_svox-0253f57b5d2454e31906bcfdfa9168587ecbef42.zip
external_svox-0253f57b5d2454e31906bcfdfa9168587ecbef42.tar.gz
external_svox-0253f57b5d2454e31906bcfdfa9168587ecbef42.tar.bz2
Fix a bug in Pico TTS engine where the current utterance couldn't be
interrupted by a call to stop(). This was due to the engine not being reset in certain code paths when a synth abort was signaled. The fix adds a call to reset the engine whenever the synthesis loop is interrupted.
Diffstat (limited to 'pico')
-rw-r--r--pico/tts/com_svox_picottsengine.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/pico/tts/com_svox_picottsengine.cpp b/pico/tts/com_svox_picottsengine.cpp
index a945a41..aa1b7e3 100644
--- a/pico/tts/com_svox_picottsengine.cpp
+++ b/pico/tts/com_svox_picottsengine.cpp
@@ -1297,6 +1297,7 @@ tts_result TtsEngine::synthesizeText( const char * text, int8_t * buffer, size_t
inp += bytes_sent;
do {
if (picoSynthAbort) {
+ ret = pico_resetEngine( picoEngine );
break;
}
/* Retrieve the samples and add them to the buffer. */
@@ -1313,6 +1314,7 @@ tts_result TtsEngine::synthesizeText( const char * text, int8_t * buffer, size_t
if (cbret == TTS_CALLBACK_HALT) {
LOGI("Halt requested by caller. Halting.");
picoSynthAbort = 1;
+ ret = pico_resetEngine( picoEngine );
break;
}
bufused = 0;