Skip to content

AudioBufferQueueConfig

Configuration for an AudioBufferQueue instance.

Defined in: src/core/types/config.ts:42

Configuration for an AudioBufferQueue instance.

Remarks

Controls the bounded FIFO queue used between pipeline stages (e.g., between an AudioInputProvider and the STT provider, or between the TTS provider and an AudioOutputProvider). The queue buffers audio frames while the downstream consumer is not yet connected (e.g., during STT WebSocket handshake) and flushes them in order once startDraining() is called.

Example

const queueConfig: AudioBufferQueueConfig = {
  name: 'input-queue',
  maxSize: 2000,
  overflowStrategy: 'drop-oldest',
};

See

CompositeVoiceConfig for where queue config is specified

Properties

PropertyTypeDefault valueDescriptionDefined in
maxSizenumber1000Maximum number of audio chunks the queue can hold before overflow handling kicks in. Remarks When the queue reaches this size and a new chunk is enqueued, the overflowStrategy determines what happens.src/core/types/config.ts:64
namestringundefinedDiagnostic name for the queue, used in log messages and stats events. Remarks When specified via CompositeVoiceConfig.queue, the SDK automatically assigns names ('input' and 'output'), so this field is optional in that context.src/core/types/config.ts:51
overflowStrategy"drop-oldest" | "drop-newest" | "block"'drop-oldest'Strategy for handling queue overflow when maxSize is reached. Remarks - 'drop-oldest' — Removes the oldest chunk to make room (default). Best for real-time audio where stale frames are less useful. - 'drop-newest' — Discards the incoming chunk. Useful when preserving the beginning of a stream is more important. - 'block' — Blocks the enqueue call until space is available. Use with caution as it can cause backpressure in the pipeline.src/core/types/config.ts:79

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency