New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Windows OneCore voices included in Windows 10. #7110

Merged
merged 13 commits into from Jun 13, 2017

Conversation

Projects
None yet
4 participants
@jcsteh
Contributor

jcsteh commented Apr 28, 2017

This uses a C++/CX dll to access the UWP SpeechSynthesizer class. There are other UWP APIs we might like to access in future (e.g. OCR), so rather than making this dll specific to OneCore speech, it's called nvdaHelperLocalWin10. The build system for this dll makes it easy to add other components in future.
In addition, this required code to generate balanced XML from an NVDA speech sequence. Although we use SSML for eSpeak, eSpeak happily accepts unbalanced (malformed) XML. OneCore speech does not. This code is in the speechXml module. This might eventually be reused to replace the ugly balanced XML code in the SAPI5 driver.
Fixes #6159.

Support for Windows OneCore voices included in Windows 10.
This uses a C++/CX dll to access the UWP SpeechSynthesizer class. There are other UWP APIs we might like to access in future (e.g. OCR), so rather than making this dll specific to OneCore speech, it's called nvdaHelperLocalWin10. The build system for this dll makes it easy to add other components in future.
In addition, this required code to generate balanced XML from an NVDA speech sequence. Although we use SSML for eSpeak, eSpeak happily accepts unbalanced (malformed) XML. OneCore speech does not. This code is in the speechXml module. This might eventually be reused to replace the ugly balanced XML code in the SAPI5 driver.

@jcsteh jcsteh requested a review from michaelDCurran Apr 28, 2017

@michaelDCurran

Attribute values should be also escaped, which will require " in xml_escapes

Show outdated Hide outdated source/synthDrivers/oneCore.py Outdated
Show outdated Hide outdated source/synthDrivers/oneCore.py Outdated
Show outdated Hide outdated nvdaHelper/localWin10/oneCoreSpeech.cpp Outdated

@jcsteh jcsteh requested a review from michaelDCurran May 3, 2017

@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh May 15, 2017

Contributor

@feerrenrut, would you mind reviewing 3b43394 and c02a788? These fix a reported issue where invalid characters break the OneCore Speech driver. @michaelDCurran originally reviewed this, but he's away for a week or so now and it'd be good to get this in ASAP.

The first commit ensures that errors get logged and don't break the driver for all subsequent speech. Previously, there was no logging and speech just went silent. The second fixes the actual problem with invalid characters.

Contributor

jcsteh commented May 15, 2017

@feerrenrut, would you mind reviewing 3b43394 and c02a788? These fix a reported issue where invalid characters break the OneCore Speech driver. @michaelDCurran originally reviewed this, but he's away for a week or so now and it'd be good to get this in ASAP.

The first commit ensures that errors get logged and don't break the driver for all subsequent speech. Previously, there was no logging and speech just went silent. The second fixes the actual problem with invalid characters.

@jcsteh jcsteh requested a review from feerrenrut May 15, 2017

@feerrenrut

As discussed, the changes look good.

jcsteh added a commit that referenced this pull request May 15, 2017

@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh May 17, 2017

Contributor

@feerrenrut, would you mind reviewing ba62552? It updates the build system to bundle some required redistributable VC2015 components that aren't installed on all systems.

Two users confirmed that this fixes the problem for them; see this nvda-devel thread.

Contributor

jcsteh commented May 17, 2017

@feerrenrut, would you mind reviewing ba62552? It updates the build system to bundle some required redistributable VC2015 components that aren't installed on all systems.

Two users confirmed that this fixes the problem for them; see this nvda-devel thread.

@jcsteh jcsteh requested a review from feerrenrut May 17, 2017

jcsteh added a commit that referenced this pull request May 18, 2017

@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh May 24, 2017

Contributor

@feerrenrut, would you mind reviewing three more commits? Sorry. :(

  1. f1a34ce deals with #6159 (comment): a document which specifies an invalid language code (or one unknown to Windows) causes an exception in the driver. We detect such language codes and ignore them. We don't do this more generally (in core speech code) because we can't assume that some other synth won't know about a language that Windows doesn't; e.g. Windows doesn't know about the Aragonese language, but NVDA and eSpeak do.
  2. 1f9f90a adds a User Guide section which I neglected to add earlier.
  3. 032e65e excludes this driver from available synths for binary copies if not Windows 10. The driver only works on Windows 10. We don't exclude for source copies because source copies can't detect Windows 10 due to Python's manifest. That's okay, though, because developers can be expected to understand such things and only developers would run from source. Note that the synth will still fail gracefully if the user attempts to use it in this case.
Contributor

jcsteh commented May 24, 2017

@feerrenrut, would you mind reviewing three more commits? Sorry. :(

  1. f1a34ce deals with #6159 (comment): a document which specifies an invalid language code (or one unknown to Windows) causes an exception in the driver. We detect such language codes and ignore them. We don't do this more generally (in core speech code) because we can't assume that some other synth won't know about a language that Windows doesn't; e.g. Windows doesn't know about the Aragonese language, but NVDA and eSpeak do.
  2. 1f9f90a adds a User Guide section which I neglected to add earlier.
  3. 032e65e excludes this driver from available synths for binary copies if not Windows 10. The driver only works on Windows 10. We don't exclude for source copies because source copies can't detect Windows 10 due to Python's manifest. That's okay, though, because developers can be expected to understand such things and only developers would run from source. Note that the synth will still fail gracefully if the user attempts to use it in this case.

@jcsteh jcsteh requested a review from feerrenrut May 24, 2017

@jcsteh jcsteh requested a review from feerrenrut May 26, 2017

@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh May 26, 2017

Contributor

@feerrenrut, as discussed, I've simplified localeNameToWindowsLCID so it returns 0 in all failure cases (with a constant of LCID_NONE). I'd prefer to just use Python's None, but I'm erring on the side of backwards compat caution. I also got rid of the oneCore synth driver tests and instead added tests for localeNameToWindowsLCID, since the method I was testing in oneCore is really just a thin wrapper around the latter.

Contributor

jcsteh commented May 26, 2017

@feerrenrut, as discussed, I've simplified localeNameToWindowsLCID so it returns 0 in all failure cases (with a constant of LCID_NONE). I'd prefer to just use Python's None, but I'm erring on the side of backwards compat caution. I also got rid of the oneCore synth driver tests and instead added tests for localeNameToWindowsLCID, since the method I was testing in oneCore is really just a thin wrapper around the latter.

@feerrenrut

I think these comments really help those who aren't familiar with this area.

Show outdated Hide outdated tests/unit/synthDrivers/test_oneCore.py Outdated
Show outdated Hide outdated source/languageHandler.py Outdated
@feerrenrut

This comment has been minimized.

Show comment
Hide comment
@feerrenrut

feerrenrut May 30, 2017

Contributor

As we discussed yesterday, don't forget to update the readme. I had to ensure that I installed Tools 1.4.1 and Windows 10 SDK 10.0.14393 with visual studio community edition to get this to build.

Contributor

feerrenrut commented May 30, 2017

As we discussed yesterday, don't forget to update the readme. I had to ensure that I installed Tools 1.4.1 and Windows 10 SDK 10.0.14393 with visual studio community edition to get this to build.

@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh May 30, 2017

Contributor

Readme updated.

Contributor

jcsteh commented May 30, 2017

Readme updated.

@jcsteh jcsteh requested a review from feerrenrut May 30, 2017

@jcsteh jcsteh merged commit 2ee954f into master Jun 13, 2017

@nvaccessAuto nvaccessAuto added this to the 2017.3 milestone Jun 13, 2017

@jcsteh jcsteh deleted the oneCoreSpeech branch Jun 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment