From 3ed0b5cd0fed4b2b557c248924f71afa810b3609 Mon Sep 17 00:00:00 2001 From: Christopher Brannon Date: Mon, 18 Jul 2016 07:45:44 -0700 Subject: [PATCH] espeak_ng_Cancel(): discard the audio, don't close the device! This function should just discard the currently playing audio, rather than close the audio device. After all, we will probably want to synthesize something else later. --- src/libespeak-ng/speech.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index 472febec..cab7ad72 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -810,7 +810,7 @@ ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Cancel(void) #ifdef HAVE_PCAUDIOLIB_AUDIO_H if ((my_mode & ENOUTPUT_MODE_SPEAK_AUDIO) == ENOUTPUT_MODE_SPEAK_AUDIO) - audio_object_close(my_audio); + audio_object_flush(my_audio); #endif embedded_value[EMBED_T] = 0; // reset echo for pronunciation announcements