Skip to main content

Overview

Voice Activity Detection (VAD) determines when speech is present in an audio stream. It’s essential for building voice interfaces that can automatically detect when users start and stop speaking.

Basic Usage

Setup

API Reference

initializeVAD

Configure VAD settings.

Configuration

processVAD

Process audio samples for voice activity.

VADResult

Continuous VAD

Continuous VAD is typically used via the Voice Agent pipeline (startVoiceSession), which handles VAD orchestration automatically. The methods below are for custom implementations.

SpeechActivityEvent

Examples

Single Frame Processing

Continuous Listening

VoiceListener.tsx

VAD with Recording

Push-to-Talk Alternative

PushToTalk.tsx

Configuration Tips

Energy Threshold

The energyThreshold determines how sensitive VAD is to speech:

Auto Calibration

Enable auto-calibration to adapt to ambient noise:

Error Handling

STT Transcribe

Speech-to-Text

Voice Agent

Full voice pipeline

STT Streaming

Real-time transcription