Skip to content

Commit

Permalink
Bypass input / output queues for audio. (#410)
Browse files Browse the repository at this point in the history
Temporary workaround to ensure that audio gets passed through
instead of potentially dropped if the input queue is full.
  • Loading branch information
j0sh authored Feb 6, 2025
1 parent 6a9a95e commit 60bb58e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion runner/app/live/streamer/protocol/trickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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]):
Expand Down

0 comments on commit 60bb58e

Please sign in to comment.