示例#1
0
 def step(self):
     id, text = self.reader.read_no_block()
     print(id, text)
     if id:
         self._failed = 0
         if text != self._current:
             stripped_text = text.strip()
             print("Read text: \"{}\"".format(stripped_text))
             play.play(stripped_text)
             self._current = text
     elif self._current:
         self._failed += 1
         if self._failed > 2:
             self._current = None
             print("Stopping")
             play.stop()
     time.sleep(1)
示例#2
0
 def stop_audio_engine(self):
     if not self._started:
         return
     stop()
     self._started = False
示例#3
0
 def stop(self):
     play.stop()
示例#4
0
 def stop(self):
     play.stop()