From a9a34666a5113e466122b48235e34523522c790c Mon Sep 17 00:00:00 2001 From: Josh Allmann Date: Wed, 5 Feb 2025 23:38:50 +0000 Subject: [PATCH] Bypass input / output queues for audio. Temporary workaround to ensure that audio gets passed through instead of potentially dropped if the input queue is full. --- runner/app/live/streamer/protocol/trickle.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runner/app/live/streamer/protocol/trickle.py b/runner/app/live/streamer/protocol/trickle.py index 91158d16..5fcccf2d 100644 --- a/runner/app/live/streamer/protocol/trickle.py +++ b/runner/app/live/streamer/protocol/trickle.py @@ -6,7 +6,7 @@ from PIL import Image -from trickle import media, TricklePublisher, TrickleSubscriber, InputFrame, OutputFrame +from trickle import media, TricklePublisher, TrickleSubscriber, InputFrame, OutputFrame, AudioFrame, AudioOutput from .protocol import StreamProtocol @@ -74,6 +74,11 @@ def dequeue_frame(): image = await asyncio.to_thread(dequeue_frame) if not image: break + # TEMP: Put audio immediately into the publish queue + # TODO: Remove once there is ComfyUI audio support + if isinstance(image, AudioFrame): + self.publish_queue.put(AudioOutput([image])) + continue yield image async def egress_loop(self, output_frames: AsyncGenerator[OutputFrame, None]):