nvda
ff43dda2 - Add automatic language switching support for SAPI5 voices (#17156)

Commit
2 years ago
Add automatic language switching support for SAPI5 voices (#17156) Fixes #17146 Summary of the issue: Automatic language switching does not work for SAPI 5 voices, because the SAPI5 synth driver does not support LangChangeCommand. This is a simple fix that uses the SAPI5 <lang> tags to make the SAPI5 framework switch to a voice in the specified language. Description of user facing changes Automatic language switching is enabled by default, so users who have SAPI5 voices in multiple languages may notice the voice switching after this change. As Microsoft Speech Platform voices use the same implementation, they will be affected as well. Description of development approach The SAPI5 <lang> tag requires a language ID in hexadecimal, without the 0x prefix (e.g. 409 for English US), so here languageHandler is imported to do the language-to-LCID conversion. The text will be wrapped in a <lang langid="409">...</lang> XML tag, or if there's no valid corresponding LCID, the <lang> tag is removed to restore the original voice.
Author
Parents
Loading