Distributing as NVDA addon
I'd like to have this utility as an NVDA addon so NVDA can switch voices automatically based on the content language. I know that multilingual voices do exist, but they often misunderstand the content language reading it with a wrong pronunciation.
The SAPI 5 voices created by this engine have the language information, but it seems that the built-in SAPI 5 voice driver in NVDA does not support automatic language switching, and the following lines appear in the log:
DEBUGWARNING - synthDrivers.sapi5.SynthDriver.speak - MainThread:
Unsupported speech command: LangChangeCommand ('en')
So if you want automatic languages switching when using SAPI 5 voices, you will have to use a third-party voice addon. For example, there's an addon called WorldVoice, which can switch to different voices according to the language of the text, and it supports SAPI 5 voices.
Speaking of an NVDA addon for natural voices, there is already such an addon called "Neural Voices", which allows you to use the Narrator natural voices. You don't need to install or download the voices yourself, because it is bundled with all the voice packs. It does not support online voices, only local ones.
I'm not the developer of that addon, and I have no relation with it, although the way NaturalVoiceSAPIAdapter accesses the Narrator voices is similar to what the addon does. Here is a post about the addon, and you can download the add-on here.
I already know the Neural Voices addon, but even that doesn't support automatic voice switching based on the language. Also, as it uses Narrator's local voices, it lacks support for many languages including Italian which is fundamental for me as it is my native language.
Then you can check if the WorldVoice addon suits your needs. It brings no additional voices, but it can switch between your installed voices based on the language, and it supports five speech engines (Espeak, OneCore, RHVoice, SAPI5, Piper). SAPI 5 is not enabled by default, but you can change that in its settings.
WorldVoice works quite well, but it makes NVDA extremely sluggish and unstable, especially when writing very fast and switching between more languages.
Good news: my pull request that makes NVDA support automatic language switching for SAPI 5 voices and Microsoft Speech Platform voices has been merged. You may see this change in NVDA 2025.1.
This should make NVDA able to switch between different SAPI 5 voices (including voices from this engine) based on the language, if you have automatic language switching enabled.
Note that currently NVDA uses the language attribute provided by the content, and it won't try to analyze the text to guess the language if there's no language attribute. Also, switching between SAPI 5 voices might be slower than switching between OneCore voices.
As for now, there's no plan to make an NVDA addon based on this engine, if NVDA can be fixed to support automatic language switching.