1616
1717from speech .commands import CallbackCommand , EndUtteranceCommand
1818
19+
20+ speakWithoutPauses = speech .SpeechWithoutPauses (speakFunc = speech .speak ).speakWithoutPauses
21+
22+
1923CURSOR_CARET = 0
2024CURSOR_REVIEW = 1
2125
@@ -150,7 +154,7 @@ def nextLine(self):
150154 if isinstance (self .reader .obj , textInfos .DocumentWithPageTurns ):
151155 # Once the last line finishes reading, try turning the page.
152156 cb = CallbackCommand (self .turnPage , name = "say-all:turnPage" )
153- speech . speakWithoutPauses ([cb , EndUtteranceCommand ()])
157+ speakWithoutPauses ([cb , EndUtteranceCommand ()])
154158 else :
155159 self .finish ()
156160 return
@@ -182,7 +186,7 @@ def _onLineReached(obj=self.reader.obj, state=state):
182186 seq = list (speech ._flattenNestedSequences (speechGen ))
183187 seq .insert (0 , cb )
184188 # Speak the speech sequence.
185- spoke = speech . speakWithoutPauses (seq )
189+ spoke = speakWithoutPauses (seq )
186190 # Update the textInfo state ready for when speaking the next line.
187191 self .speakTextInfoState = state .copy ()
188192
@@ -204,7 +208,7 @@ def _onLineReached(obj=self.reader.obj, state=state):
204208 else :
205209 # We don't want to buffer too much.
206210 # Force speech. lineReached will resume things when speech catches up.
207- speech . speakWithoutPauses (None )
211+ speakWithoutPauses (None )
208212 # The first buffered line has now started speaking.
209213 self .numBufferedLines -= 1
210214
@@ -241,7 +245,7 @@ def finish(self):
241245 # we might switch synths too early and truncate the final speech.
242246 # We do this by putting a CallbackCommand at the start of a new utterance.
243247 cb = CallbackCommand (self .stop , name = "say-all:stop" )
244- speech . speakWithoutPauses ([
248+ speakWithoutPauses ([
245249 EndUtteranceCommand (),
246250 cb ,
247251 EndUtteranceCommand ()
0 commit comments