Skip to content

Fix ctypes argument error in setProsodyParam #123

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

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

ultrasound1372
Copy link
Contributor

It appears that when using the earcons and speech rules add-on in browsers, somehow a prosody parameter of some type other than int makes it to the driver. When this happens, since ctypes refuses to coerce a float to an int by itself, an exception is thrown. This causes NVDA to completely hang when the exception is thrown and all synth threads are locked up.

This PR fixes this hang by simply wrapping the vl argument in a call to int() when passing to dll.eciSetVoiceParam.

Note that, while this makes the earcons and speech rules add-on technically usable with this driver, there is still the matter of indexing, which is a separate issue to be solved. Whether that's via #96 or some other approach, depending on WASAPI, is up to you, but it should be done at some point soon.

…apparently sends the wrong type sometimes and this causes the entire thread to hang because of a ctypes exception.
@davidacm davidacm merged commit 63e5802 into davidacm:master Feb 24, 2025
2 checks passed
@ultrasound1372 ultrasound1372 deleted the fix_arg_error branch March 1, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants