fix termination story

This commit is contained in:
Ajay Raj 2023-02-27 10:08:30 -08:00
commit a773179946

View file

@ -50,8 +50,11 @@ class Conversation:
def play_audio(self): def play_audio(self):
async def run(): async def run():
while self.active: while self.active:
audio = self.output_audio_queue.get() try:
await self.output_device.send_async(audio) audio = self.output_audio_queue.get(timeout=5)
await self.output_device.send_async(audio)
except queue.Empty:
continue
loop = asyncio.new_event_loop() loop = asyncio.new_event_loop()
loop.run_until_complete(run()) loop.run_until_complete(run())