From 6ce38738f522a0c0e2ea51a55ba03108a6a0292d Mon Sep 17 00:00:00 2001 From: bel Date: Sat, 25 Mar 2023 21:44:34 -0600 Subject: [PATCH] hotwords is K --- whisper-2023/hotwords.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/whisper-2023/hotwords.py b/whisper-2023/hotwords.py index bcdc2ec..0ac7e2d 100644 --- a/whisper-2023/hotwords.py +++ b/whisper-2023/hotwords.py @@ -148,7 +148,7 @@ class Reactor(threading.Thread): for i in hotwords: if i in cleantext: log(f"Reactor.handle: found hotword '{i}' in '{text}' as '{cleantext}'") - self.outq.put(i) + self.outq.put((i, text)) class Actor(threading.Thread): def __init__(self, inq): @@ -158,14 +158,14 @@ class Actor(threading.Thread): def run(self): log("Actor.run: start") while True: - hotword = self.inq.get() + hotword, context = self.inq.get() if hotword is None: break - self.handle(hotword) + self.handle(hotword, context) log("Actor.run: stop") - def handle(self, hotword): - print(hotword) + def handle(self, hotword, context): + print(f'{hotword} in {context}') if __name__ == "__main__": main()