AudioOutput implementation that buffers agent speech frames into a stream/queue so they can be consumed by an external transport (e.g. a custom websocket protocol used by an avatar plugin). Frames captured via captureFrame flow through the underlying stream as-is; on flush an AudioSegmentEnd sentinel is appended; on clearBuffer a 'clear_buffer' event is emitted with a QueueAudioOutputClearEvent payload so the consumer can drop any in-flight bytes and notify upstream of an interruption.

Mirrors Python's livekit.agents.voice.avatar.QueueAudioOutput.

Ref: python livekit-agents/livekit/agents/voice/avatar/_queue_io.py

Hierarchy (view full)

Constructors

Properties

sampleRate?: number
EVENT_PLAYBACK_FINISHED: "playbackFinished" = 'playbackFinished'
EVENT_PLAYBACK_STARTED: "playbackStarted" = 'playbackStarted'

Accessors

  • get canPause(): boolean
  • Whether this output and all outputs in the chain support pause/resume.

    Returns boolean

Methods

  • Convenience wrapper around AudioOutput.onPlaybackFinished so a remote transport can announce segment completion (or interruption) without needing access to the protected method.

    Parameters

    • playbackPosition: number
    • interrupted: boolean

    Returns void

  • Called when playback actually starts (first frame is sent to output). Developers building audio sinks should call this when the first frame is captured.

    Parameters

    • createdAt: number

    Returns void