diff --git a/whisper-2023/hotwords.py b/whisper-2023/hotwords.py index 8792cd3..590e05f 100644 --- a/whisper-2023/hotwords.py +++ b/whisper-2023/hotwords.py @@ -24,6 +24,20 @@ def main(): def log(*args): print(">", *args, file=sys.stderr) +class Piper(threading.Thread): + def __init__(self, inq, outq): + threading.Thread.__init__(self) + self.inq = inq + self.outq = outq + + def run(self): + while True: + got = self.inq.get() + if got is None: + break + self._run(got) + self.outq.put(None) + class Manager(threading.Thread): def __init__(self, outq): threading.Thread.__init__(self)