48
48
CharacterModeCommand ,
49
49
PhonemeCommand ,
50
50
IndexCommand ,
51
- ProsodyCommand ,
51
+ BaseProsodyCommand ,
52
52
SpeechCommand ,
53
53
SynthCommand ,
54
54
)
79
79
r"|(?P<content>[^<]+)" ,
80
80
)
81
81
82
- PROSODY_COMMANDS : dict [str , ProsodyCommand ] = {
82
+ PROSODY_COMMANDS : dict [str , BaseProsodyCommand ] = {
83
83
"pitch" : PitchCommand ,
84
84
"volume" : VolumeCommand ,
85
85
"rate" : RateCommand ,
@@ -169,7 +169,7 @@ def convertSSMLTextForNVDA(text: str) -> list[str | SpeechCommand]:
169
169
if language != nvdaLanguage :
170
170
out .append (LangChangeCommand (language ))
171
171
172
- resetProsody : list [Type ["ProsodyCommand " ]] = []
172
+ resetProsody : list [Type ["BaseProsodyCommand " ]] = []
173
173
# log.info(f"\ntext: {text}")
174
174
for m in RE_MATHML_SPEECH .finditer (text ):
175
175
if m .lastgroup == "break" :
@@ -188,13 +188,13 @@ def convertSSMLTextForNVDA(text: str) -> list[str | SpeechCommand]:
188
188
out .append (PitchCommand (multiplier = int (m .group (m .lastgroup ))))
189
189
resetProsody .append (PitchCommand )
190
190
elif m .lastgroup in PROSODY_COMMANDS :
191
- command : Type ["ProsodyCommand " ] = PROSODY_COMMANDS [m .lastgroup ]
191
+ command : Type ["BaseProsodyCommand " ] = PROSODY_COMMANDS [m .lastgroup ]
192
192
if command in supportedCommands :
193
193
out .append (command (multiplier = int (m .group (m .lastgroup )) / 100.0 ))
194
194
resetProsody .append (command )
195
195
elif m .lastgroup == "prosodyReset" :
196
196
# for command in resetProsody: # only supported commands were added, so no need to check
197
- command : Type ["ProsodyCommand " ] = resetProsody .pop ()
197
+ command : Type ["BaseProsodyCommand " ] = resetProsody .pop ()
198
198
out .append (command (multiplier = 1 ))
199
199
elif m .lastgroup == "phonemeText" :
200
200
if usePhoneme :
@@ -293,7 +293,7 @@ def getBrailleRegions(
293
293
def getScript (
294
294
self ,
295
295
gesture : KeyboardInputGesture ,
296
- ) -> Callable [KeyboardInputGesture , None ] | None :
296
+ ) -> Callable [[ KeyboardInputGesture ] , None ] | None :
297
297
"""
298
298
Returns the script function bound to the given gesture.
299
299
@@ -550,7 +550,7 @@ def getSpeechForMathMl(
550
550
synth : SynthDriver = getSynth ()
551
551
synthConfig = config .conf ["speech" ][synth .name ]
552
552
if synth .name == "espeak" :
553
- _synthesizerRate : int = synthConfig ["rate" ]
553
+ _synthesizerRate = synthConfig ["rate" ]
554
554
# log.info(f'_synthesizer_rate={_synthesizer_rate}, get_rate()={getSynth()._get_rate()}')
555
555
getSynth ()._set_rate (_synthesizerRate )
556
556
# log.info(f'..............get_rate()={getSynth()._get_rate()}, name={synth.name}')
0 commit comments