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
- AudioInputConfig for capture configuration
- CompositeVoiceConfig for the top-level SDK configuration
Extended by
Properties
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
bufferSize? | number | 4096 | Buffer 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? | boolean | true | Whether 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? | number | 200 | Minimum 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? | number | undefined | Sample 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 |