Skip to content
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

Synth drivers/eSpeak NG internal: pass in a NULL pointer (path string) when obtaining eSpeak NG version string #11975

Merged
merged 3 commits into from
Jan 11, 2021

Conversation

josephsl
Copy link
Collaborator

Hi,

Needed for Python 3.8, although it is equally applicable to Python 3.7 and makes NVDA code more compliant with eSpeak NG API:

Link to issue number:

None

Summary of the issue:

eSpeak NG fails to load on Python 3.8 version of NVDA, traced to espeak.dll::espeak_Info function not receiving path string.

Description of how this pull request fixes the issue:

Pass in NULL (None) when eSepak NG asks for path string in sepak_Info function because what NVDA is interested in is eSpeak NG version string.

Testing performed:

Tested under source code and via a private binary copy:

  • Success in Python 3.7 version
  • Success in Python 3.8 version

Known issues with pull request:

None

Change log entry:

None

Impact:

This is one of the major changes required to move NVDA to Python 3.8, especially given that eSpeak NG will be set as default speech synthesizer on Windows releases other than 10.

Thanks.

…ersion info.

Python 3.8: without passing in a path string, access violation is thrown, which can cause NVDA executable to hang when trying to obtain eSpeak NG version string. Therefore pass in NULL (None) because what NVDA is interested in is synthesizer version.
@AppVeyorBot
Copy link

See test results for failed build of commit f155bc4941

#Copyright (C) 2007-2017 NV Access Limited, Peter Vágner
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
# synthDrivers/_espeak.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this line to comply with the standard for copyright headers.

@@ -369,7 +369,8 @@ def terminate():
onIndexReached = None

def info():
return espeakDLL.espeak_Info()
# Python 3.8: a path string must be specified, a NULL is fine when what we need is version string.
return espeakDLL.espeak_Info(None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this function returns bytes, and the only place in which it is used is the message in the log stating which version of eSpeak is in use have you considered decoding this to avoid leading "b" being shown in the log viewer i.e.:
return espeakDLL.espeak_Info(None).decode()

@josephsl
Copy link
Collaborator Author

josephsl commented Dec 27, 2020 via email

Comment from Lukasz Golonka: remove file name from copyright header, use bytes.decode to transform eSpeak NG version string from bytes to Unicode.
@AppVeyorBot
Copy link

See test results for failed build of commit 63aca1d339

@michaelDCurran michaelDCurran merged commit 4c49001 into nvaccess:master Jan 11, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.1 milestone Jan 11, 2021
@josephsl josephsl deleted the espeakInfoPointer branch January 11, 2021 15:08
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.

5 participants