Fall back to OneCore synth on Windows 10 if a 3rd party synth fails to load#9025
Conversation
…ore should be tried as one of the default synthesizers to fall back to on Windows 10.
| nextIndex=defaultSynthPriorityList.index(name)+1 | ||
| except ValueError: | ||
| nextIndex=0 | ||
| if nextIndex<len(defaultSynthPriorityList): |
There was a problem hiding this comment.
In the very unlikely case that the silence synthesizer does not load, will this create an endless loop? I.e.
- OneCore doesn't load, go to espeak
- Espeak doesn't load, go to silence
- Silence doesn't load, index is 0, go to OneCore
I guess that if nextIndex==len(defaultSynthPriorityList) means that we're stuck with regard to speech. Should we account for this?
|
I don't understand the following:
"3. Silence doesn't load, index is 0, go to OneCore".
As silence is in the list, and is the last item, nextIndex would be
len(defaultSynthPriorityList).
Then in the case where nextIndex is len(defaultSynthPriorityList)
nothing happens and setSynth returns false.
This was always the case.
I'm not sure there is really anything we can do here.
And really we are sort of expecting that espeak and silence will never
fail, which I think is fair enough.
|
LeonarddeR
left a comment
There was a problem hiding this comment.
I don't understand the following: "3. Silence doesn't load, index is 0, go to OneCore". As silence is in the list, and is the last item, nextIndex would be len(defaultSynthPriorityList).
Ah yes, you're right. I missread the code and thought that index would return to 0 instead of len(defaultSynthPriorityList). Go ahead, and sorry for the misunderstanding.
|
To take this further, should SAPI 5 be in the list after espeak? It's a fringe case, but better to have some speech than none. |
Link to issue number:
Mentioned in pr #8006
Summary of the issue:
If NVDA is configured to load a 3rd party synth and the loading of that synth fails, NVDA then falls back to eSpeak. However on Windows 10, it really should fallback to OneCore, as OneCore is the default synth for NVDA on Windows 10.
This was specifically noticed with the merging of #8006 where if a synth from an incompatible add-on was in use when updating to a 2019.1 pre build, that synth would fail to load due to the add-on being disabled. On Windows 10 this would fallback to eSpeak, but it really should be oneCore.
Description of how this pull request fixes the issue:
In synthDriverHandler there is now a defaultSynthPriorityList which contains the names of all synths (in priority order) that should be tried by default. E.g. oneCore, espeak, silence.
Now if the loading of a synth fails, NVDA will fallback to the next available synth in that list.
For example, if a 3rd party synth fails to load, then on Windows 10, it will go to OneCore. On lower Operating Systems it will go to espeak.
However, if for instance oneCore fails to load, it will try the next thing in the list, which is espeak.
Testing performed:
Set NVDA to a 3rd party synth (NVSpeechPlayer). Disabled the add-on, restarted NVDA, NVDA switched to oneCore.
Known issues with pull request:
None.
Change log entry:
Bug fixes:
If a 3rd party speech synthesizer fails to load, NVDA will fall back to Windows OneCore speech on Windows 10, rather than espeak.