From f06c2eed8fdd994f7a8d3237779703800b7e4690 Mon Sep 17 00:00:00 2001 From: bel Date: Sat, 25 Mar 2023 21:50:51 -0600 Subject: [PATCH] add base class to start --- whisper-2023/hotwords.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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)