def iterate(self): self._proxy.setBusy(False) while 1: if self._stopping: # have to do the cancel on the main thread, not inside the # callback else deadlock _espeak.Cancel() self._stopping = False self._proxy.notify('finished-utterance', completed=False) self._proxy.setBusy(False) yield
def startLoop(self): first = True self._looping = True while self._looping: if first: # kick the queue self._proxy.setBusy(False) first = False if self._stopping: # have to do the cancel on the main thread, not inside the # callback else deadlock _espeak.Cancel() self._stopping = False self._proxy.notify('finished-utterance', completed=False) self._proxy.setBusy(False) time.sleep(0.01)