Skip to content

MicrophoneInputConfig

Configuration for MicrophoneInput.

Defined in: src/providers/input/MicrophoneInput.ts:72

Configuration for MicrophoneInput.

Remarks

Extends AudioInputConfig with an optional debug flag. Provided as a distinct type for forward-compatibility and for consistency with the provider-config-per-class convention used throughout the SDK.

Example

import { MicrophoneInput } from 'composite-voice';

const input = new MicrophoneInput({
  sampleRate: 16000,
  format: 'pcm',
  channels: 1,
  echoCancellation: true,
  noiseSuppression: true,
});

See

Extends

Properties

PropertyTypeDefault valueDescriptionInherited fromDefined in
autoGainControl?booleantrueWhether to enable the browser’s automatic gain control. Remarks Normalizes microphone input volume, which helps when users speak at varying distances from the microphone.AudioInputConfig.autoGainControlsrc/core/types/audio.ts:156
channels?number1Number of audio channels. Remarks Use 1 for mono (recommended for speech) or 2 for stereo.AudioInputConfig.channelssrc/core/types/audio.ts:112
chunkDuration?number100Duration of each audio chunk sent to the STT provider, in milliseconds. Remarks Lower values reduce latency but increase the number of chunks sent. Typical values range from 20ms to 250ms.AudioInputConfig.chunkDurationsrc/core/types/audio.ts:123
debug?booleanfalseWhether to enable debug logging for this provider.-src/providers/input/MicrophoneInput.ts:78
echoCancellation?booleantrueWhether to enable the browser’s echo cancellation processing. Remarks Strongly recommended when using speaker output simultaneously with microphone capture to prevent the TTS audio from being re-transcribed by the STT provider.AudioInputConfig.echoCancellationsrc/core/types/audio.ts:134
formatAudioFormatundefinedAudio format/codec for encoding captured audio. See AudioFormatAudioInputConfig.formatsrc/core/types/audio.ts:102
noiseSuppression?booleantrueWhether to enable the browser’s noise suppression processing. Remarks Reduces background noise for cleaner transcriptions. Recommended for most environments unless you need raw audio fidelity.AudioInputConfig.noiseSuppressionsrc/core/types/audio.ts:145
sampleRatenumberundefinedSample rate in Hz for audio capture. Remarks Common values are 16000 (speech-optimized), 24000, and 48000 (high fidelity). Most STT providers perform best at 16000 Hz.AudioInputConfig.sampleRatesrc/core/types/audio.ts:95

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency