diff --git a/voice_recognition.py b/voice_recognition.py index 4ffecf3..579b594 100644 --- a/voice_recognition.py +++ b/voice_recognition.py @@ -154,6 +154,7 @@ class Transcriber(commands.Cog): logger.info("Connected") vc = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient) logger.info(self.bot.voice_clients) + self.check_data.start() self.worker.start() vc.listen(self.wsink) @@ -199,13 +200,15 @@ class Transcriber(commands.Cog): @commands.command(name="stop_transcribe") async def stop(self, ctx): self.check_data.stop() - self.worker.stop() + self.comm_queue.put("STOP") await ctx.voice_client.disconnect() def transcribe_output_queue(queue): logger.info("Worker start") while True: - queue.get() + item = queue.get() + if item == "STOP": + break logger.info("PING") async def setup(bot):