From 1c440e5a42ef2606c0330f816b00172ab309505c Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Sat, 20 Jun 2009 16:17:42 -0500 Subject: [PATCH] fixed stop_speech issue The stop_speech function needs to test the return code from espeak_Cancel() to be sure the operation was successful before signaling the callback to stop the audio. --- synth.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/synth.c b/synth.c index f7f13c3..8d5c076 100644 --- a/synth.c +++ b/synth.c @@ -114,8 +114,12 @@ espeak_ERROR set_volume(struct synth_t * s, int vol, enum adjust_t adj) espeak_ERROR stop_speech(void) { - stopped = 1; - return (espeak_Cancel()); + espeak_ERROR rc; + + rc = espeak_Cancel(); + if (rc == EE_OK) + stopped = 1; + return rc; } espeak_ERROR speak_text(struct synth_t * s)