sapi5: skip over invalid voices rather than causing the entire driver to fail#20430
Open
michaelDCurran wants to merge 5 commits into
Open
sapi5: skip over invalid voices rather than causing the entire driver to fail#20430michaelDCurran wants to merge 5 commits into
michaelDCurran wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the SAPI5 (64-bit) synth driver initialization so that malformed/invalid voice tokens no longer cause the entire driver to fail. It does this by enumerating voice token IDs directly from the registry and creating tokens one-by-one, skipping those that fail to instantiate.
Changes:
- Add registry-based enumeration of SAPI5 voice token IDs and per-token creation/validation.
- Update
_getVoiceTokensto return only successfully created tokens (skipping invalid ones). - Update voice selection to create a token directly from the stored voice ID, avoiding a full re-enumeration.
Contributor
|
Can this be included in the 2026.2? |
Member
Author
|
Probably not. This needs a lot of testing on alpha.
|
This was referenced Jul 1, 2026
seanbudd
reviewed
Jul 2, 2026
Member
|
should this target beta since #20128 is on the 2026.2 milestone? |
…an just calling getVoices, so that invalid voices can be skipped without causing the entire driver to fail. Also setting a voice from an ID creates the token directly, rather than needing to enumerate all tokens.
…o the voice list.
Co-authored-by: Sean Budd <sean@nvaccess.org>
Member
Author
|
I have rebased this on beta. |
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 #20128
Summary of the issue:
The sapi5 driver can fail completely at initialization, if there is an invalid voice token found in the registry.
Currently NVDA asks sapi5 to enumerate all voices itself using ISpeechVoice::getVoices, however any invalid voice causes the entire enumeration to fail with a COM error.
Description of user facing changes:
Description of developer facing changes:
Description of development approach:
Testing strategy:
Known issues with pull request:
None known.
Code Review Checklist: