Skip to content

AudioOutputConfig

Configuration for audio output (playback).

Defined in: src/core/types/audio.ts:189

Configuration for audio output (playback).

Remarks

Controls how the SDK plays back synthesized audio from TTS providers. These settings affect the AudioContext and buffering behavior used for playback. The SDK applies sensible defaults via DEFAULT_AUDIO_OUTPUT_CONFIG if you do not specify these values.

Example

import { CompositeVoice } from 'composite-voice';

const agent = new CompositeVoice({
  stt: mySTTProvider,
  llm: myLLMProvider,
  tts: myTTSProvider,
  audio: {
    output: {
      bufferSize: 4096,
      minBufferDuration: 200,
      enableSmoothing: true,
    },
  },
});

See

Extended by

Properties

PropertyTypeDefault valueDescriptionDefined in
bufferSize?number4096Buffer size for audio playback in samples. Remarks Larger buffers reduce glitches but increase latency. Smaller buffers provide lower latency but may cause audio dropouts on slower devices.src/core/types/audio.ts:199
enableSmoothing?booleantrueWhether to enable audio smoothing when stitching adjacent chunks. Remarks Applies crossfading between consecutive audio chunks to eliminate clicks and pops at chunk boundaries. Recommended for streaming TTS.src/core/types/audio.ts:231
minBufferDuration?number200Minimum buffer duration before starting playback, in milliseconds. Remarks The audio player waits until this much audio has been buffered before beginning playback. Higher values produce smoother audio at the cost of increased initial latency.src/core/types/audio.ts:211
sampleRate?numberundefinedSample rate for the AudioContext used for playback. Remarks If not specified, the SDK uses the sample rate reported in AudioMetadata from the TTS provider, or the browser’s default.src/core/types/audio.ts:220

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency