Looking at pyttsx3/drivers/espeak.py driver, I altered the method startLoop in pyttsx3/drivers/sapi5.py:
def startLoop(self):
first = True
self._looping = True
while self._looping:
if first:
self._proxy.setBusy(False)
first = False
if not pythoncom.PumpWaitingMessages() and self._looping:
self._stopping = False
self._proxy.notify('finished-utterance', completed=False)
self._proxy.setBusy(False)
time.sleep(0.05)
I do not see how the method
runAndWait()
can return, there seems to be no guard condition in thestartLoop
method. https://github.com/nateshmbhat/pyttsx3/blob/5d3755b060a980f48fcaf81df018dd06cbd17a8f/pyttsx3/drivers/sapi5.py#L124-L132Looking at
pyttsx3/drivers/espeak.py
driver, I altered the methodstartLoop
inpyttsx3/drivers/sapi5.py
: