Merged
Conversation
seanbudd
reviewed
Aug 11, 2025
seanbudd
approved these changes
Aug 11, 2025
Member
|
Thanks @gexgd0419 ! It seems all known issues with the changes to SAPI4 and SAPI5 are solved now? Much appreciated |
seanbudd
pushed a commit
that referenced
this pull request
Aug 22, 2025
Fixes #18674. Fixes #18676. Fixes #18760. Summary of the issue: NVDA becomes unresponsive for a small period of time when speaking some text in SAPI5 voices. #18658 leaves more audio data for the EndStream handler to be played, which causes NVDA to be frozen when the EndStream handler is feeding the remaining audio chunks. Description of user facing changes: The above issue should be fixed. Description of developer facing changes: None Description of development approach: Moves the feeding logic in EndStream to the dedicated speak thread, avoiding blocking the SAPI5 thread that EndStream runs on. The main thread no longer waits for cancellation to complete in order to prevent freezing. The dedicated speak thread for WASAPI will be stopped and restarted when WASAPI is turned on or off, in order to prevent errors accessing the player when WASAPI is turned off and the player no longer exists.
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.
Link to issue number:
Fixes #17967.
Summary of the issue:
When rate boost is enabled and the rate is fast enough, if some audio takes longer time to process, an audio gap might appear in the speech audio.
Description of user facing changes:
The audio gap issue should be fixed.
Description of developer facing changes:
None.
Description of development approach:
Wait for at least 50ms of audio data before sending the first chunk to the output device.
This mitigates the problem when the first small chunk is immediately played, but during processing of the next chunk, there isn't enough audio to cover this duration, leaving audible gaps.
Also the return value of
IStream::Writeis changed toS_OKinstead of an error code during cancellation.Testing strategy:
Tested with VW Julie with the text "i unselected" to confirm there's no gap in the audio.
Known issues with pull request:
This might slightly increase the speech delay since audio won't be immediately played.
Code Review Checklist:
@coderabbitai summary