Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speech.c: fifo_stop() creates a noticeable delay (at least in NetBSD), call audio_object_flush() first. #1874

Open
adr-adr opened this issue Mar 11, 2024 · 0 comments

Comments

@adr-adr
Copy link

adr-adr commented Mar 11, 2024

Hi, this patch resolve the issue stated in the title:

--- src/libespeak-ng/speech.c.orig	2022-04-02 19:24:41.000000000 +0000
+++ src/libespeak-ng/speech.c
@@ -881,15 +881,14 @@ ESPEAK_API const char *espeak_TextToPhon
 
 ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Cancel(void)
 {
-#ifdef USE_ASYNC
-	fifo_stop();
-	event_clear_all();
-#endif
-
 #ifdef HAVE_PCAUDIOLIB_AUDIO_H
 	if ((my_mode & ENOUTPUT_MODE_SPEAK_AUDIO) == ENOUTPUT_MODE_SPEAK_AUDIO)
 		audio_object_flush(my_audio);
 #endif
+#ifdef USE_ASYNC
+	fifo_stop();
+	event_clear_all();
+#endif
 	embedded_value[EMBED_T] = 0; // reset echo for pronunciation announcements
 
 	for (int i = 0; i < N_SPEECH_PARAM; i++)

speech.c.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant