diff --git a/synth.c b/synth.c index 991a11a..1ef8250 100644 --- a/synth.c +++ b/synth.c @@ -37,6 +37,7 @@ const int rateMultiplier = 34; const int rateOffset = 84; const int volumeMultiplier = 22; +static int user_data = 0; volatile int runner_must_stop = 0; static espeak_ERROR set_frequency(struct synth_t *s, int freq, enum adjust_t adj) @@ -125,8 +126,12 @@ static espeak_ERROR set_volume(struct synth_t * s, int vol, enum adjust_t adj) static espeak_ERROR stop_speech(void) { + espeak_ERROR rc; + stop_audio(); - return (espeak_Cancel()); + rc = espeak_Cancel(); + user_data = (user_data + 1) % 100; + return rc; } static espeak_ERROR speak_text(struct synth_t * s) @@ -135,7 +140,7 @@ static espeak_ERROR speak_text(struct synth_t * s) allow_audio(); rc = espeak_Synth(s->buf, s->len + 1, 0, POS_CHARACTER, 0, 0, NULL, - NULL); + &user_data); return rc; }