diff --git a/whisper-2023/hotwords.py b/whisper-2023/hotwords.py index 0ac7e2d..8792cd3 100644 --- a/whisper-2023/hotwords.py +++ b/whisper-2023/hotwords.py @@ -147,7 +147,7 @@ class Reactor(threading.Thread): cleantext = "".join([i for i in "".join(text.lower().split()) if i.isalpha()]) for i in hotwords: if i in cleantext: - log(f"Reactor.handle: found hotword '{i}' in '{text}' as '{cleantext}'") + #log(f"Reactor.handle: found hotword '{i}' in '{text}' as '{cleantext}'") self.outq.put((i, text)) class Actor(threading.Thread): @@ -158,14 +158,14 @@ class Actor(threading.Thread): def run(self): log("Actor.run: start") while True: - hotword, context = self.inq.get() - if hotword is None: + got = self.inq.get() + if got is None: break - self.handle(hotword, context) + self.handle(got[0], got[1]) log("Actor.run: stop") def handle(self, hotword, context): - print(f'{hotword} in {context}') + print(f"'{hotword}' in '{context}'") if __name__ == "__main__": main()