-
-
Notifications
You must be signed in to change notification settings - Fork 659
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
Fix SAPI4 failing to load some voices #17726
Conversation
See test results for failed build of commit fe03cedc25 |
Given there's no related issue filed, can you please provide more information? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good
I'd love to file an Issue later today to provide more background about this fix. |
There is a very old Chinese speech engine called IBM Chinese TTS Runtime that had been unusable for many years, even causing the Microsoft Speech API version 4 driver to fail to load for users who installed it. This pull request fixes the issue and makes the speech engine work properly again. |
Ahh, sorry I didn't say it earlier, PitchCommand doesn't work in the current implementation. |
Link to issue number:
None
Summary of the issue:
The SAPI4 synth driver fails to load some voices, because the voices do not support certain parameters, or because the voices do not expect the client to create multiple instances of
ITTSCentral
objects (with feature flagTTSFEATURE_SINGLEINSTANCE
).The synth driver tries to detect whether a parameter is supported or not when loading the voice. However,
removeSetting
is checking against thename
attribute of each setting, which should now be calledid
. This can cause errors when loading a voice that does not support all the parameters.Description of user facing changes
Some of the SAPI4 voices will no longer fail to load.
Description of development approach
In
removeSetting
,if s.name == name
is changed toif s.id == name
.Before creating a new
ITTSCentral
object, and whenterminate
is called, set both_ttsCentral
and_ttsAttrs
toNone
to release the previousITTSCentral
object.Ignore the exception thrown from
_ttsCentral.UnRegister
. Some voices do not handle this well, and the wholeITTSCentral
will be released anyway.Some voices keep the pausing state even after resetting, meaning that they will still pause the audio after
_ttsCentral.AudioReset
and silence the output. A variable_paused
is used to track the pausing state, and if it's paused, unpause it before resetting.Testing strategy:
Manually tested with some voices.
Known issues with pull request:
None yet
Code Review Checklist:
@coderabbitai summary