Skip to content

Commit 60bb58e

Browse files
authored
Bypass input / output queues for audio. (#410)
Temporary workaround to ensure that audio gets passed through instead of potentially dropped if the input queue is full.
1 parent 6a9a95e commit 60bb58e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

runner/app/live/streamer/protocol/trickle.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from PIL import Image
88

9-
from trickle import media, TricklePublisher, TrickleSubscriber, InputFrame, OutputFrame
9+
from trickle import media, TricklePublisher, TrickleSubscriber, InputFrame, OutputFrame, AudioFrame, AudioOutput
1010

1111
from .protocol import StreamProtocol
1212

@@ -74,6 +74,11 @@ def dequeue_frame():
7474
image = await asyncio.to_thread(dequeue_frame)
7575
if not image:
7676
break
77+
# TEMP: Put audio immediately into the publish queue
78+
# TODO: Remove once there is ComfyUI audio support
79+
if isinstance(image, AudioFrame):
80+
self.publish_queue.put(AudioOutput([image]))
81+
continue
7782
yield image
7883

7984
async def egress_loop(self, output_frames: AsyncGenerator[OutputFrame, None]):

0 commit comments

Comments
 (0)