diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2009-07-15 16:44:38 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2009-07-15 16:44:38 -0700 |
commit | 0253f57b5d2454e31906bcfdfa9168587ecbef42 (patch) | |
tree | cb5297a25d224fc81cf3cc52ebabff623efeb9d9 /pico/tts | |
parent | 498b2c1776cdc2324e6792ad564c6ff3b589298f (diff) | |
download | external_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/tts')
-rw-r--r-- | pico/tts/com_svox_picottsengine.cpp | 2 |
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; |