Skip to content

WebRTCInputConfig

Configuration for WebRTCInput.

Defined in: src/providers/input/WebRTCInput.ts:112

Configuration for WebRTCInput.

Remarks

A source may be supplied up-front via track or stream, or attached later (and swapped live) with setTrack() / setStream(). If both track and stream are provided, track wins.

Example

import { WebRTCInput } from 'composite-voice';

// Source known up-front
const input = new WebRTCInput({ track: remoteTrack, targetSampleRate: 16000 });

// Source attached later
const lateInput = new WebRTCInput();
pc.ontrack = (e) => lateInput.setTrack(e.track);

See

WebRTCInput for where this config is consumed

Properties

PropertyTypeDefault valueDescriptionDefined in
debug?booleanfalseWhether to enable debug logging for this provider.src/providers/input/WebRTCInput.ts:150
stream?MediaStreamundefinedRemote media stream to consume. Remarks The stream’s audio is mixed by the browser’s MediaStreamAudioSourceNode; only the first audio track’s mix is captured (mono downmix).src/providers/input/WebRTCInput.ts:131
targetSampleRate?number16000Sample rate (Hz) of the PCM emitted to the pipeline. Remarks The provider requests an AudioContext at this rate; if the browser cannot honor it, audio is downsampled to this rate before emission. Most STT providers perform best at 16000 Hz.src/providers/input/WebRTCInput.ts:143
track?MediaStreamTrackundefinedRemote audio track to consume. Remarks Typically obtained from RTCPeerConnection’s ontrack event or from a WebRTC SDK (LiveKit RemoteAudioTrack.mediaStreamTrack, Daily, etc.). Takes precedence over stream when both are provided.src/providers/input/WebRTCInput.ts:122

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency