Exit meeting after saying something for samples 1 and 2
This commit is contained in:
@@ -261,6 +261,7 @@ class DailyTransportService(EventHandler):
|
||||
for frame in frames:
|
||||
if frame.frame_type == FrameType.END_STREAM:
|
||||
self.logger.info("Stopping frame consumer thread")
|
||||
self.output_queue.task_done()
|
||||
return
|
||||
|
||||
# if interrupted, we just pull frames off the queue and discard them
|
||||
|
||||
@@ -39,6 +39,13 @@ async def main(room_url):
|
||||
async for audio in audio_generator:
|
||||
transport.output_queue.put(OutputQueueFrame(FrameType.AUDIO_FRAME, audio))
|
||||
|
||||
# Put an "end stream" item on the queue, which will cause it to shut down when it's processed
|
||||
# all the audio.
|
||||
transport.output_queue.put(OutputQueueFrame(FrameType.END_STREAM, None))
|
||||
transport.output_queue.join()
|
||||
|
||||
transport.stop()
|
||||
|
||||
await transport.run()
|
||||
|
||||
|
||||
|
||||
@@ -32,6 +32,9 @@ async def main(room_url):
|
||||
|
||||
@transport.event_handler("on_participant_joined")
|
||||
async def on_participant_joined(transport, participant):
|
||||
if participant["id"] == transport.my_participant_id:
|
||||
return
|
||||
|
||||
current_text = ""
|
||||
async for text in llm_generator:
|
||||
current_text += text
|
||||
@@ -40,6 +43,13 @@ async def main(room_url):
|
||||
transport.output_queue.put(OutputQueueFrame(FrameType.AUDIO_FRAME, audio))
|
||||
current_text = ""
|
||||
|
||||
# Put an "end stream" item on the queue, which will cause it to shut down when it's processed
|
||||
# all the audio.
|
||||
transport.output_queue.put(OutputQueueFrame(FrameType.END_STREAM, None))
|
||||
transport.output_queue.join()
|
||||
|
||||
transport.stop()
|
||||
|
||||
await transport.run()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user