Repository navigation
Speech Dispatcher: Cancel queued speech on stop and interrupt - #158
Merged
Merged
Conversation
spd_stop ends only the message being spoken, so speech the client had already queued kept playing after a stop, and an interrupting speak was queued behind it instead of replacing it. spd_cancel also discards the client's queue. Signed-off-by: Dan <[email protected]>
The Wine bridge had the same problem as the native backend: spd_stop ends only the message being spoken, so queued speech kept playing after a stop, and an interrupting speak was queued behind it. spd_cancel also discards the client's queue. Signed-off-by: Dan <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
stop()and the interrupting path inspeak()calledspd_stop, which ends only the message being spoken. Anything already queued then kept playing, and text spoken withinterruptset waited behind the queue instead of replacing it. Both now callspd_cancel, which also discards the client's queue. Orca's own Speech Dispatcher driver uses cancel for the same reason.spd_cancelis bound at run time like the otherspd_functions, in place ofspd_stop, which nothing calls any more. This is the same kind of problem as #71 in the UIA backend.The Speech Dispatcher Wine bridge (
winelibs/speechd/bridge.cpp) had the same twospd_stopcalls, so the second commit makes the same change there; the Spiel bridge already cancels. The bridge builds with Prism's winelib toolchain, asPRISM_BUILD_WINELIBSbuilds it, and passes clang-tidy (Wine 10.0, winegcc over GCC 14), but I haven't run it under Wine.Tested on master (b68e9c9) on Debian 13 (x86_64), speech-dispatcher 0.12.1 from trixie-backports with the Eloquence and espeak-ng modules, built with GCC 14.2 and linted with clang-tidy 22:
interruptoff, thenprism_backend_stopduring the first: silence, and none of the others play. Before this change, the rest of the queue kept playing.interrupton while others are queued: heard at once, in place of the queue.There's no regression test: this needs a running speech-dispatcher, and I couldn't see an existing pattern for testing the Linux backends. I'm happy to add one if you can point me at how you'd like it done.