Drop unsupported language switching commands for OneCore#13779
Conversation
See test results for failed build of commit 700ad28992 |
|
|
||
| import os | ||
| import sys | ||
| from typing import Any, Callable, Generator, List, Optional, Set, Tuple, Union |
There was a problem hiding this comment.
We get better diffs for subsequent updates if these are one per line:
| from typing import Any, Callable, Generator, List, Optional, Set, Tuple, Union | |
| from typing import ( | |
| Any, | |
| Callable, | |
| Generator, | |
| List, | |
| Optional, | |
| Set, | |
| Tuple, | |
| Union, | |
| ) |
| defaultLanguage: str, | ||
| availableLanguages: Set[str], |
There was a problem hiding this comment.
Please add docs for these, examples are specifically helpful. Are they expected to be 'en' or 'en-au' etc.
There was a problem hiding this comment.
These are both fully qualified OneCore language codes, e.g. "en_US".
| rate: float, | ||
| pitch: float, | ||
| volume: float, |
There was a problem hiding this comment.
I assume these are expected to be 0->1 values, if you can confirm please add to the doc string.
There was a problem hiding this comment.
This is actually from 0-100, but supports decimal changes
| _ocSpeechToken: Optional[ctypes.POINTER] | ||
| _queuedSpeech: List[Union[str, Tuple[Callable[[ctypes.POINTER, float], None], float]]] |
There was a problem hiding this comment.
Shouldn't this typing be in the init method? Doesn't having it here indicate these are expected to be used as class variables?
|
Hello
|
|
@CyrilleB79 - it looks like you've found a new regression in 2022.2 for portable copies of NVDA. |
feerrenrut
left a comment
There was a problem hiding this comment.
Assuming the build passes.
Link to issue number:
Fixes #13732
Summary of the issue:
OneCore keeps a cache of voices for NVDA in the registry.
OneCore fails to automatic language switch when remnants of a previously installed OneCore language exist in the cache.
This causes speech to not be announced.
This is only an issue for installed copies, as portable copies bypass the NVDA OneCore cache.
Description of how this pull request fixes the issue:
Drop the language change command if a given language is unsupported by OneCore.
Testing strategy:
Manual testing
Using the following HTML sample, test language switching.
Replace the language code "zh" as appropriate.
data:text/html,<p>Hello</p><p lang="zh">world</p>.Using installed oneCore languages
'en_au', 'fr_fr', 'en_us', 'zh_hk'Automatic language switching is successful for the following language codes:
Automatic language switching reverts to the default voice for the following language codes:
Known issues with pull request:
None
Change log entries:
Bug fixes
Code Review Checklist: