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
- AudioInputConfig for the base configuration fields
- MicrophoneInput for where this config is consumed
Extends
Properties
| Property | Type | Default value | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
autoGainControl? | boolean | true | Whether 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.autoGainControl | src/core/types/audio.ts:156 |
channels? | number | 1 | Number of audio channels. Remarks Use 1 for mono (recommended for speech) or 2 for stereo. | AudioInputConfig.channels | src/core/types/audio.ts:112 |
chunkDuration? | number | 100 | Duration 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.chunkDuration | src/core/types/audio.ts:123 |
debug? | boolean | false | Whether to enable debug logging for this provider. | - | src/providers/input/MicrophoneInput.ts:78 |
echoCancellation? | boolean | true | Whether 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.echoCancellation | src/core/types/audio.ts:134 |
format | AudioFormat | undefined | Audio format/codec for encoding captured audio. See AudioFormat | AudioInputConfig.format | src/core/types/audio.ts:102 |
noiseSuppression? | boolean | true | Whether 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.noiseSuppression | src/core/types/audio.ts:145 |
sampleRate | number | undefined | Sample 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.sampleRate | src/core/types/audio.ts:95 |