---
updatedAt: 2026-10-09T20:37:33.000Z
agentTools:
  projectIndex: https://sdk-docs.krisp.ai/llms.txt
---

# VAD

Use Voice Activity Detection with Krisp noise and background voice cancellation in the JS SDK.

### Overview

Voice Activity Detection (VAD) is a component in audio processing that determines whether the incoming audio contains speech. In this implementation, VAD helps control the noise cancellation process and optimizes audio transmission.

## KrispSDK constructor arguments

| Property               | Type   | Default   | Description                                             |
| ---------------------- | ------ | --------- | ------------------------------------------------------- |
| params.models.modelNC  | String | undefined | path to the NC model used for sampling rates above 8KHz |
| params.models.modelVAD | String | undefined | path to the VAD model                                   |

```javascript
let krispSDK = new KrispSDK({
  params: {
    // ...other params
    models: {
      // ...other models
      modelNC: "/dist/models/c6.f.s.da1785.kef",
      modelVAD: "/dist/models/vad_2.0.0_1.0.kef",
    },
  },
});
```

<br />

## Noise Filter Creation

```javascript
const audioSettings = {
  audio: {
    echoCancellation: false,
    noiseSuppression: false,
    autoGainControl: false,
  },
};

const stream = await navigator.mediaDevices.getUserMedia(audioSettings);

const source = audioContext.createMediaStreamSource(stream);
const destination = audioContext.createMediaStreamDestination();

const filterParam = {
	audioContext,
  useVAD: true, // Toggle VAD with this paramter
  vad: {
    // The VAD threshold is a configurable value that dictates when an audio signal is classified as speech or silence.
    // It is compared against the output of the VAD processing function to decide if speech is present
    threshold: 0.5,
  },
};

const filterNode = await krispSDK.createNoiseFilter(filterParam, onReady);

source.connect(filterNode).connect(destination);

destination.stream; // destination stream is the resulting stream which can be used in your business logic
```

The accuracy of VAD depends on the chosen threshold value. A lower threshold may classify more background noise as speech, while a higher threshold might cause speech to be ignored.

# Sibling pages

* [Getting Started](https://sdk-docs.krisp.ai/docs/getting-started-js.md)
* [Debugging](https://sdk-docs.krisp.ai/docs/debugging.md)
* [Noise Canceling Level Control](https://sdk-docs.krisp.ai/docs/noise-canceling-level-control.md)
* [Examples](https://sdk-docs.krisp.ai/docs/examples-js.md)