NaturalVoiceSAPIAdapter icon indicating copy to clipboard operation
NaturalVoiceSAPIAdapter copied to clipboard

Natural voice adapter does not work with x64 NVDA on ARM64 Windows

Open hozosch opened this issue 1 month ago • 12 comments

As you probably know, NVDA 2026.1 will be a pure 64 bit program. Having the 64 bit variant of voice adapter installed makes sapi5 not work with the current alpha snapshots. Uninstalling them will eliminate this issue, and 2025.3.1, which is still a 32 bit version of NVDA, works well with those voices. Here's what the log says. WARNING - synthDriverHandler.SynthDriver.loadSettings (17:04:18.719) - MainThread (6472): Invalid voice: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_DE-DE_HEDDA_11.0 ERROR - synthDriverHandler.setSynth (17:04:18.720) - MainThread (6472): setSynth failed for sapi5 Traceback (most recent call last): File "synthDriverHandler.pyc", line 378, in loadSettings File "synthDriverHandler.pyc", line 428, in changeVoice File "synthDrivers\sapi5.pyc", line 764, in _set_voice File "synthDrivers\sapi5.pyc", line 639, in _getVoiceTokens _ctypes.COMError: (-2147200967, None, ('Pattern not found', None, None, 0, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "synthDriverHandler.pyc", line 510, in setSynth File "synthDriverHandler.pyc", line 480, in getSynthInstance File "synthDriverHandler.pyc", line 369, in initSettings File "synthDriverHandler.pyc", line 384, in loadSettings File "synthDriverHandler.pyc", line 428, in changeVoice File "synthDrivers\sapi5.pyc", line 764, in _set_voice File "synthDrivers\sapi5.pyc", line 639, in _getVoiceTokens _ctypes.COMError: (-2147200967, None, (None, None, None, 0, None))

hozosch avatar Oct 30 '25 16:10 hozosch

I couldn't reproduce this issue with the latest NVDA alpha build (portable), and adapter v0.2.6 x64, in a Win10 virtual machine.

Could you provide more details, such as:

  • Exact NVDA alpha version, adapter version, and Windows version?
  • Is there anything in the adapter's log file?
  • Does the TtsApplication x64 still work, and does other x64 SAPI5 clients still work?
  • Your adapter settings (offline/online, languages, etc.)?
  • What SAPI5 voices work, and what don't?
  • Does the issue still happen on a freshly installed NVDA instance with no add-ons, etc.?

gexgd0419 avatar Oct 31 '25 06:10 gexgd0419

I'm also using the latest Alpha snapshot as a portable version with natural voice adapter 0.2.6, but on Windows 11 ARm 64. With NVDA, no sapi5 voice will work, the synthesizer will fail to load, which is not the case with 32 bit versions of NVDA. Other details will follow later, there's just one thing. How do I get the log from the voice adapter?

hozosch avatar Oct 31 '25 07:10 hozosch

Launch the installer, then choose Open log & cache folder. You will see the "log.txt" file.

Windows Arm64's 64-bit environment can be more complex, since there are different supported "64-bit architectures", and also not easy to test for me, since I don't have access to a Windows Arm64 device, and Arm64 emulators are just too slow on x64.

Just to make sure, are you using the "full" version of the adapter that acutally has support for Arm64, instead of the x86_x64 one?

gexgd0419 avatar Oct 31 '25 07:10 gexgd0419

Yes, I deliberately chose to use the one marked as arm64.

hozosch avatar Oct 31 '25 08:10 hozosch

Ah, there's also one detail I can give you now, I'm using both online Edge and local narrator voices, with US English and German. I only have two German local Narrator voices, the online voices are both US English and German. But it doesn't matter whether I have the local Narrator voices installed or not, the issue only goes away when the 64 bit version is completely uninstalled.

hozosch avatar Oct 31 '25 08:10 hozosch

Are there any related errors/warnings in the adapter's log?

gexgd0419 avatar Oct 31 '25 08:10 gexgd0419

[2025-10-30 15:58:26.411] [warning] Proxy: Failed to get proxy settings, connections will be made directly: (winhttp:12006) The URL does not use a recognized protocol. And then also this one, but not as often: [2025-10-28 20:05:28.061] [warning] Proxy: Failed to get proxy settings, connections will be made directly: (winhttp:12167) An error occurred while downloading the proxy auto-configuration script..

hozosch avatar Oct 31 '25 17:10 hozosch

Can other SAPI5 clients, for example the TtsApplication.exe inside the adapter, use SAPI5 voices?

gexgd0419 avatar Oct 31 '25 17:10 gexgd0419

I just tried them with narrator, and actually, they do work! Not only that, in NVDA, the multilingual voices are all over the place with recognizing languages sometimes, I also noticed this with balabolka. Maybe it's got something to do with the 32 bit version, but with Narrator, they are much more consistent in keeping German as the language, maybe because it's my system language.

hozosch avatar Oct 31 '25 17:10 hozosch

Oh, sorry, wrong info about the multilingual voices, it happens with Narrator too. It's just that they sometimes stick to one language, and other times, they jump all over the place, and need to have longer fragments of text to know what language it is. But That's probably a problem with the voices themselves, which you have no control over, same for their responsiveness.

hozosch avatar Oct 31 '25 17:10 hozosch

I reproduced the issue in an ARM64 evnironment. On ARM64 Windows, pure ARM64 apps work fine with the adapter (such as the built-in Narrator), but x64 apps do not. The 64-bit version of NVDA is x64, not ARM64.

The adapter's installation process on ARM64 is broken somehow, and as a result, the ARM64X forwarder, which is responsible for loading the corresponding ARM64 or x64 version of the adapter DLL, isn't installed correctly, so now only the ARM64 version works.

Before I release a version that fixes this problem, you can fix this manually, by changing the (Default) registry value in HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{b8b9e38f-e5a2-4661-9fde-4ac7377aa6f6}\InprocServer32. This value should be the file path of NaturalVoiceSAPIAdapter.dll. On ARM64 systems, change the file name from NaturalVoiceSAPIAdapter.dll to Arm64XForwarder.dll, and leave the rest of the path unchanged. Then, it should work.

gexgd0419 avatar Nov 01 '25 04:11 gexgd0419

I just tried it, and I can load sapi5 now, but the voices don't work, I get a class not registered error in the NVDA log whenever they try to speak. Does this mean I have to do a regsvr 32? I already tried that, and this broke sapi5 again, so I reinstalled the voices and changed the path again, so I'm back with a working sapi5 driver, but the voices don't work when I select them, they throw a class not registered error.

hozosch avatar Nov 01 '25 12:11 hozosch