Conversation
|
How is this related to #12646? |
| self._consecutiveSpeechFailures += 1 | ||
| if self._consecutiveSpeechFailures >= self.MAX_CONSECUTIVE_SPEECH_FAILURES: | ||
| log.debugWarning("Too many consecutive speech failures, changing synth") | ||
| setNextSynth(self.name) |
There was a problem hiding this comment.
I'm a bit worried about this implementation, i.e. a synth driver calling a synthDriverHandler function. Could you consider something like the braille handler does, i.e. in _writeCells, it tries to write content to a display. If that fails, it calls handleDisplayUnavailable which performs the fallback.
I think it might be best to use a new exception type for this, e.g. ConsecutiveSPeechFailureException. The OneCore synth can throw that exception in its speak method when it notices the self._consecutiveSpeechFailures limit has been exceeded. Then, the speech manager can catch the exception and perform the fallback.
There was a problem hiding this comment.
Handling failures here is quite tricky. I've opted to queue a synth change instead here
ERROR - unhandled exception (11:22:58.596) - Dummy-3 (20092):
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 232, in 'calling callback function'
File "synthDrivers\oneCore.py", line 373, in _callback
raise AssertionError()
AssertionError
See test results for failed build of commit 7214a0ed52 |
| Fetches the locale name of the user's configured language in Windows. | ||
| """ | ||
| windowsLCID=ctypes.windll.kernel32.GetUserDefaultUILanguage() | ||
| windowsLCID = ctypes.windll.kernel32.GetUserDefaultLCID() |
There was a problem hiding this comment.
ctypes.windll.kernel32.GetUserDefaultUILanguage() returned 'en_GB' when all of my language preferences (including voices) were set to 'en_AU'.
There was a problem hiding this comment.
Please add a comment here to explain the choice of GetUserDefaultLCID over GetUserDefaultUILanguage.
Have you checked the history of this to see if it was previously GetUserDefaultLCID?
There was a problem hiding this comment.
This was changed in a2f0b75, to fix #353. I believe #353 should still be fixed by this change still, or at least improved, as when we try to set the language for the translation service, we now attempt to just use the language code if the country code is not supported.
@LeonarddeR has also made a suggestion to change this to GetUserPreferredUILanguages in #7999, which is another move to consider and probably fix #353 in a more meaningful way. That way we could try multiple preferred languages (with and without country code) and give better internationalisation support.
I think I could revert this change and attempt a fix for that after 2021.2 beta is out
feerrenrut
left a comment
There was a problem hiding this comment.
Please add docs to these tests to explain the situations they are testing.
| self.assertEqual(synthName, synthDriverHandler.getSynth().name) | ||
| self.assertEqual(self._oldSynthConfig, config.conf["speech"]["synth"]) | ||
|
|
||
| def test_setSynth_oneCoreSupportsDefaultLangauge(self): |
There was a problem hiding this comment.
| def test_setSynth_oneCoreSupportsDefaultLangauge(self): | |
| def test_setSynth_oneCoreSupportsDefaultLanguage(self): | |
Link to issue number:
Fixes #10451 and fixes #11544
Summary of the issue:
#10451
OneCore voices silently fail when attempting to speak an alphabet they don't support (eg an English voice reading Cyrillic characters). This makes installing NVDA for the first time for the first time inaccessible if someone is using a system with a language that isn't supported by their OneCore installed voices.
#11544
An issue was raised on #11543 where oneCore failed to initialise, causing all speech to fail.
If no speech succeeds, the
_playeris never set and so a subsequent error is thrown in_processQueue.Description of how this pull request fixes the issue:
#10451
When picking a synthesizer automatically (using "auto", ie not overriden by a user), fail if the current NVDA language and current system language is not supported by installed OneCore voices.
#11544
If oneCore fails to speak more than N=5 times in a row, try the next synth on the synth priority list.
Testing strategy:
#10451
Manual confirmation that this fixes the issue by installing NVDA:
And having espeak set and read the install dialogs.
Manual confirmation that setting/changing synthesizers works and is respected across restarts.
#11544
Hard to test as it requires a failure external to NVDA, which is unknown how to reproduce. Ensure
oneCoreworks as a synthesizer normally otherwise.Known issues with pull request:
None
Change log entries:
Bug fixes
Code Review Checklist: