diff --git a/voice_recognition.py b/voice_recognition.py index 01ba122..15e9a14 100644 --- a/voice_recognition.py +++ b/voice_recognition.py @@ -50,7 +50,7 @@ class WaveWriter: self.transcript_file_future.setsampwidth(SAMPLE_WIDTH) self.transcript_file_future.setframerate(SAMPLING_RATE) - def rotate(self): + async def rotate(self): self.transcript_file_present.close() self.file_name_past = self.file_name_present @@ -70,7 +70,7 @@ class WaveWriter: operation = CommunicationObject(msg_type="send_file",user=self.user,data=[self.file_name_present]) logger.info("Item added to queue %s %s", self.queue, operation) - self.queue.put(operation) + await self.queue.put(operation) def writeframes(self, pcmdata): self.transcript_file_present.writeframes(pcmdata) @@ -161,7 +161,7 @@ class Transcriber(commands.Cog): logger.info("File rotation time since last rotation %s", timediff_rotation/1e9) item[2] = time.time_ns() item[4] = False - item[0].rotate() + await item[0].rotate() item[3] = False @commands.Cog.listener() @@ -177,7 +177,7 @@ class Transcriber(commands.Cog): logger.info("User %s disconnected from channel %s", user, before.channel.name) operation = CommunicationObject(msg_type="user_cleanup", user=user, data=None) logger.info("Item added to queue %s %s", self.comm_queue, operation) - self.comm_queue.put(operation) + await self.comm_queue.put(operation) else: logger.info("User VC status changed %s", user.id) logger.info("Before %s", before) @@ -190,7 +190,7 @@ class Transcriber(commands.Cog): stop_token = CommunicationObject("STOP",None,None) logger.info("Item added to queue %s %s", self.comm_queue, stop_token) - self.comm_queue.put(stop_token) + await self.comm_queue.put(stop_token) await ctx.voice_client.disconnect() async def transcribe_output_queue(self):