From 0253f57b5d2454e31906bcfdfa9168587ecbef42 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Wed, 15 Jul 2009 16:44:38 -0700 Subject: 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. --- pico/tts/com_svox_picottsengine.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pico') 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; -- cgit v1.1