---
title: "Voice Activity Detection (VAD) | Micdrop"
description: "Micdrop uses a VAD (Voice Activity Detection) to detect speech and silence and send chunks of audio to the server only when speech is detected."
url: "https://micdrop.dev/docs/client/vad"
---

*   [Getting Started](/docs/getting-started)
*   [Client (Browser)](/docs/client)
    
    *   [Installation](/docs/client/installation)
    *   [React Hooks](/docs/client/react-hooks)
    *   [Start/Stop Call](/docs/client/start-stop-call)
    *   [Pause/Resume Call](/docs/client/pause-resume-call)
    *   [Mute/Unmute Call](/docs/client/mute-unmute-call)
    *   [Call State](/docs/client/call-state)
    *   [Display Conversation Messages](/docs/client/display-conversation-messages)
    *   [Handling Tool Calls](/docs/client/handling-tool-calls)
    *   [Device Management](/docs/client/devices-management)
    *   [Voice Activity Detection (VAD)](/docs/client/vad)
    *   [Error Handling](/docs/client/error-handling)
    *   Utility Classes
        
        *   [Mic](/docs/client/utility-classes/mic)
        *   [MicdropClient](/docs/client/utility-classes/micdrop-client)
        *   [MicRecorder](/docs/client/utility-classes/mic-recorder)
        *   [Speaker](/docs/client/utility-classes/speaker)
        
    
*   [Server (Node.js)](/docs/server)
    
    *   [Installation](/docs/server/installation)
    *   [With Fastify](/docs/server/with-fastify)
    *   [With NestJS](/docs/server/with-nestjs)
    *   [Auth and Parameters](/docs/server/auth-and-parameters)
    *   [First Message](/docs/server/first-message)
    *   [Save Messages](/docs/server/save-messages)
    *   [Resume a Conversation](/docs/server/resume-conversation)
    *   [Recording Audio](/docs/server/recording-audio)
    *   [Error Handling](/docs/server/error-handling)
    *   [Tools](/docs/server/tools)
    *   [Extract Value from Answer](/docs/server/extract)
    *   [Auto End Call](/docs/server/auto-end-call)
    *   [Semantic Turn Detection](/docs/server/semantic-turn-detection)
    *   [Noise Filtering](/docs/server/noise-filtering)
    *   [Micdrop Protocol](/docs/server/protocol)
    
*   [AI Integrations](/docs/ai-integration)
    
    *   Provided Integrations
        
        *   [AI SDK](/docs/ai-integration/provided-integrations/ai-sdk)
        *   [Cartesia](/docs/ai-integration/provided-integrations/cartesia)
        *   [ElevenLabs](/docs/ai-integration/provided-integrations/elevenlabs)
        *   [Gladia](/docs/ai-integration/provided-integrations/gladia)
        *   [Gradium](/docs/ai-integration/provided-integrations/gradium)
        *   [Mistral](/docs/ai-integration/provided-integrations/mistral)
        *   [OpenAI](/docs/ai-integration/provided-integrations/openai)
        
    *   Custom Integrations
        
        *   [Agent (LLM)](/docs/ai-integration/custom-integrations/custom-agent)
        *   [Speech-to-Text (STT)](/docs/ai-integration/custom-integrations/custom-stt)
        *   [Text-to-Speech (TTS)](/docs/ai-integration/custom-integrations/custom-tts)
        
    *   Fallback Strategies
        
        *   [FallbackAgent](/docs/ai-integration/fallback-strategies/agent-fallback)
        *   [FallbackSTT](/docs/ai-integration/fallback-strategies/stt-fallback)
        *   [FallbackTTS](/docs/ai-integration/fallback-strategies/tts-fallback)
        
    *   [IA Vocale Souveraine 🇫🇷🇪🇺](/docs/ai-integration/sovereign-voice-ai)
    

[Micdrop](/) › [Documentation](/docs/getting-started)

# Voice Activity Detection (VAD)

Micdrop uses a VAD (Voice Activity Detection) to detect speech and silence and send chunks of audio to the server only when speech is detected.

For the concepts behind these options, how volume detection compares with a Silero model and how to tune latency against false positives, read [Voice Activity Detection in the Browser](/blog/voice-activity-detection-browser).

## Supported VAD Types

Micdrop supports the following VADs by name:

*   `'volume'`: Volume-based VAD (default)
*   `'silero'`: AI-based VAD using Silero

You can also pass instances of these VADs, or combine them in an array. See below for details.

> **Note:** Only `'volume'` and `'silero'` are supported as string names. Custom VADs must be passed as instances.

## Quick Start

Configure VAD when starting a call:

```
import { Micdrop } from '@micdrop/client'
// Use volume-based detection (default)await Micdrop.start({  url: 'ws://localhost:8081',  vad: 'volume',})
// Use AI-based detection for better accuracyawait Micdrop.start({  url: 'ws://localhost:8081',  vad: 'silero',})
// Combine multiple VADs for best resultsawait Micdrop.start({  url: 'ws://localhost:8081',  vad: ['volume', 'silero'],})
```

Or when starting the microphone (before starting the call):

```
Micdrop.startMic({ vad: 'volume' })
```

## Volume VAD: Speech detection based on volume

By default, `MicdropClient` uses `VolumeVAD` for speech detection. You can use it explicitly when starting Micdrop:

```
Micdrop.start({ vad: 'volume' })
```

or when starting the microphone (before starting the call):

```
Micdrop.startMic({ vad: 'volume' })
```

It is inspired by [hark](https://github.com/otalk/hark) and triggers speech detection events based on volume changes.

You can also pass an instance of `VolumeVAD` to `MicdropClient`:

```
const vad = new VolumeVAD({  history: 5, // Number of frames to consider for volume calculation  threshold: -55, // Threshold in decibels for speech detection})Micdrop.start({ vad })
```

*   **Default options:** `{ history: 5, threshold: -55 }`
*   **Persistence:** Options are saved to `localStorage` and restored automatically.

**When to use Volume VAD:**

*   ✅ Low latency requirements
*   ✅ Quiet environments
*   ✅ Clear speech patterns
*   ❌ Noisy environments
*   ❌ Soft-spoken users

## Silero VAD: Human speech detection with AI

To use `SileroVAD` for speech detection:

```
Micdrop.start({ vad: 'silero' })
```

It is based on [@ricky0123/vad-web](https://github.com/ricky0123/vad) which runs a [Silero VAD](https://github.com/snakers4/silero-vad) model in the browser using [ONNX Runtime Web](https://github.com/microsoft/onnxruntime/tree/main/js/web).

It is more accurate than `VolumeVAD` and works better with low voice.

You can also pass an instance of `SileroVAD` to `MicdropClient`:

```
const vad = new SileroVAD({  positiveSpeechThreshold: 0.18, // Threshold for positive speech detection  negativeSpeechThreshold: 0.11, // Threshold for negative speech detection  minSpeechFrames: 8, // Minimum number of frames to consider for speech detection  redemptionFrames: 20, // Number of frames to consider for silence detection})Micdrop.start({ vad })
```

*   **Default options:** `{ positiveSpeechThreshold: 0.18, negativeSpeechThreshold: 0.11, minSpeechFrames: 8, redemptionFrames: 20 }`
*   **Persistence:** Options are saved to `localStorage` and restored automatically.

**When to use Silero VAD:**

*   ✅ Noisy environments
*   ✅ Soft-spoken users
*   ✅ Multiple speakers
*   ✅ Background music/TV
*   ❌ Extremely low latency needs (adds ~50ms processing)

## Multiple VAD: Combine multiple VADs

Combining multiple VADs is useful to get more accurate speech detection:

*   Volume to ignore low voice
*   Silero to detect human speech

You can combine multiple VADs by passing an array of VAD names:

```
Micdrop.start({ vad: ['volume', 'silero'] })
```

Or with instances:

```
const vad = [new VolumeVAD(), new SileroVAD()]Micdrop.start({ vad })
```

Or mix names and instances:

```
await Micdrop.start({  vad: ['volume', new SileroVAD({ positiveSpeechThreshold: 0.15 })],})
```

**How it works:**

*   `StartSpeaking` is emitted when any VAD detects possible speech.
*   `ConfirmSpeaking` is emitted only when _all_ VADs confirm speech.
*   `StopSpeaking` is emitted when _all_ VADs detect silence.
*   `CancelSpeaking` is emitted if all VADs agree speech was a false positive.

This approach reduces false positives while maintaining quick response times.

## VAD Events

VADs emit the following events:

*   `StartSpeaking`: Possible speech detected (not yet confirmed)
*   `ConfirmSpeaking`: Speech confirmed
*   `CancelSpeaking`: Speech start was a false positive (noise, etc.)
*   `StopSpeaking`: Speech ended
*   `ChangeStatus`: Status changed (`Silence`, `MaybeSpeaking`, `Speaking`)

Monitor VAD activity in your application:

```
Micdrop.vad.on('StartSpeaking', () => {  console.log('🎤 Possible speech detected...')  showListeningIndicator()})
Micdrop.vad.on('ConfirmSpeaking', () => {  console.log('✅ Speech confirmed - recording')  highlightMicrophoneButton()})
Micdrop.vad.on('StopSpeaking', () => {  console.log('🔇 Speech ended')  resetMicrophoneButton()})
Micdrop.vad.on('CancelSpeaking', () => {  console.log('❌ False positive - not speech')  hideListeningIndicator()})
Micdrop.vad.on('ChangeStatus', (status) => {  console.log('VAD status:', status) // 'Silence', 'MaybeSpeaking', 'Speaking'})
```

## Custom VAD

You can also pass your own VAD implementation:

```
Micdrop.start({ vad: new MyCustomVAD() })
```

See [VolumeVAD](https://github.com/Godefroy/micdrop/blob/main/packages/client/src/audio/vad/VolumeVAD.ts) as an example.

## VAD Delay

All VADs have a `delay` property (default: 100ms) that controls the interval for speech detection checks. You can adjust this in custom VADs if needed.

## Tuning VAD Performance

### Volume VAD Tuning

Adjust sensitivity based on environment:

```
// Quiet environment - more sensitiveconst quietVad = new VolumeVAD({  threshold: -65, // Lower threshold for quiet voices  history: 3, // Faster response})
// Noisy environment - less sensitiveconst noisyVad = new VolumeVAD({  threshold: -45, // Higher threshold to ignore noise  history: 8, // More frames for stability})
```

### Silero VAD Tuning

Fine-tune AI detection:

```
// More sensitive - catches quiet speechconst sensitiveVad = new SileroVAD({  positiveSpeechThreshold: 0.15, // Lower threshold  minSpeechFrames: 6, // Faster confirmation})
// More conservative - reduces false positivesconst conservativeVad = new SileroVAD({  positiveSpeechThreshold: 0.22, // Higher threshold  minSpeechFrames: 12, // More confirmation needed  redemptionFrames: 30, // Longer silence confirmation})
```

## Dynamic VAD Configuration

You can update VAD settings in real-time without restarting:

```
// Update Volume VAD settingsconst volumeVad = Micdrop.vad as VolumeVADvolumeVad.setOptions({ threshold: -45 })
// Update Silero VAD settingsconst sileroVad = Micdrop.vad as SileroVADsileroVad.setOptions({ positiveSpeechThreshold: 0.15 })
// Reset to default optionsvolumeVad.resetOptions()sileroVad.resetOptions()
```

## Persistent Settings

Both VolumeVAD and SileroVAD settings are automatically saved to localStorage and restored when loading with their names (`'volume'` or `'silero'`) and not instances.

## React VAD Settings UI

See a complete React component for VAD configuration based on the demo client: [VADSettings](https://github.com/Godefroy/micdrop/blob/main/examples/demo-client/src/components/VADSettings.tsx)

[Previous← Device Management](/docs/client/devices-management)[NextError Handling →](/docs/client/error-handling)

On this page

*   [Supported VAD Types](#supported-vad-types)
*   [Quick Start](#quick-start)
*   [Volume VAD: Speech detection based on volume](#volume-vad-speech-detection-based-on-volume)
*   [Silero VAD: Human speech detection with AI](#silero-vad-human-speech-detection-with-ai)
*   [Multiple VAD: Combine multiple VADs](#multiple-vad-combine-multiple-vads)
*   [VAD Events](#vad-events)
*   [Custom VAD](#custom-vad)
*   [VAD Delay](#vad-delay)
*   [Tuning VAD Performance](#tuning-vad-performance)
*   [Volume VAD Tuning](#volume-vad-tuning)
*   [Silero VAD Tuning](#silero-vad-tuning)
*   [Dynamic VAD Configuration](#dynamic-vad-configuration)
*   [Persistent Settings](#persistent-settings)
*   [React VAD Settings UI](#react-vad-settings-ui)
