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
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions source/synthDrivers/_espeak.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: UTF-8 -*-
#synthDrivers/_espeak.py
#A part of NonVisual Desktop Access (NVDA)
#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.

# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2007-2020 NV Access Limited, Peter Vágner
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

import time
import nvwave
Expand Down Expand Up @@ -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()


def getVariantDict():
dir = os.path.join(globalVars.appDir, "synthDrivers", "espeak-ng-data", "voices", "!v")
Expand Down