From aaff0c767df7c0ed6153aa6b4e0a51d3a96da76d Mon Sep 17 00:00:00 2001 From: trypolis <60036684+TyGillespie@users.noreply.github.com> Date: Sat, 13 Mar 2021 21:54:00 -0700 Subject: [PATCH 1/2] Updated to work with speech.commands. --- nvdaAddon/manifest.ini.in | 2 +- nvdaAddon/synthDrivers/nvSpeechPlayer/__init__.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nvdaAddon/manifest.ini.in b/nvdaAddon/manifest.ini.in index 4e2d931..6ae9883 100644 --- a/nvdaAddon/manifest.ini.in +++ b/nvdaAddon/manifest.ini.in @@ -4,4 +4,4 @@ description=A free Klatt-based speech synthesizer author=_author_ version=_version_ minimumNVDAVersion = 2019.3.0 -lastTestedNVDAVersion = 2019.3.1 +lastTestedNVDAVersion = 2020.4 diff --git a/nvdaAddon/synthDrivers/nvSpeechPlayer/__init__.py b/nvdaAddon/synthDrivers/nvSpeechPlayer/__init__.py index 3e84c99..de42182 100644 --- a/nvdaAddon/synthDrivers/nvSpeechPlayer/__init__.py +++ b/nvdaAddon/synthDrivers/nvSpeechPlayer/__init__.py @@ -1,7 +1,7 @@ ### #This file is a part of the NV Speech Player project. #URL: https://bitbucket.org/nvaccess/speechplayer -#Copyright 2014 NV Access Limited. +#Copyright 2014-2021 NV Access Limited, Ty Gillespie. #This program is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License version 2.0, as published by #the Free Software Foundation. @@ -27,6 +27,7 @@ from synthDrivers import _espeak from synthDriverHandler import SynthDriver, VoiceInfo, synthIndexReached, synthDoneSpeaking from driverHandler import NumericDriverSetting +from speech.commands import IndexCommand, PitchCommand class AudioThread(threading.Thread): @@ -153,8 +154,8 @@ def check(cls): supportedSettings=(SynthDriver.VoiceSetting(),SynthDriver.RateSetting(),SynthDriver.PitchSetting(),SynthDriver.VolumeSetting(),SynthDriver.InflectionSetting()) supportedCommands = { - speech.IndexCommand, - speech.PitchCommand, + IndexCommand, + PitchCommand, } supportedNotifications = {synthIndexReached,synthDoneSpeaking} @@ -183,7 +184,7 @@ def speak(self,speakList): for item in speakList: if isinstance(item,speech.PitchCommand): pitchOffset=item.offset - elif isinstance(item,speech.IndexCommand): + elif isinstance(item,IndexCommand): userIndex=item.index elif isinstance(item,str): textList=re_textPause.split(item) From eb437aa5fe17720d7177c163ff6d5fe13795efbf Mon Sep 17 00:00:00 2001 From: trypolis <60036684+TyGillespie@users.noreply.github.com> Date: Fri, 26 Mar 2021 08:18:40 -0600 Subject: [PATCH 2/2] Now works with the autoSettingsUtils change. --- nvdaAddon/synthDrivers/nvSpeechPlayer/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nvdaAddon/synthDrivers/nvSpeechPlayer/__init__.py b/nvdaAddon/synthDrivers/nvSpeechPlayer/__init__.py index de42182..0ba72c8 100644 --- a/nvdaAddon/synthDrivers/nvSpeechPlayer/__init__.py +++ b/nvdaAddon/synthDrivers/nvSpeechPlayer/__init__.py @@ -26,12 +26,10 @@ from logHandler import log from synthDrivers import _espeak from synthDriverHandler import SynthDriver, VoiceInfo, synthIndexReached, synthDoneSpeaking -from driverHandler import NumericDriverSetting +from autoSettingsUtils.driverSetting import NumericDriverSetting from speech.commands import IndexCommand, PitchCommand - class AudioThread(threading.Thread): - wavePlayer=None keepAlive=True isSpeaking=False