> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# KrispVivaVadAnalyzer

> Voice Activity Detection analyzer using the Krisp VIVA SDK

## Overview

`KrispVivaVadAnalyzer` is a Voice Activity Detection (VAD) analyzer that uses the Krisp VIVA SDK to detect speech in audio streams. It provides high-accuracy speech detection with support for multiple sample rates.

## Installation

```bash theme={null}
uv add "pipecat-ai[krisp]"
```

## Prerequisites

You need a Krisp VIVA VAD model file (`.kef` extension). Set the model path via:

* The `model_path` constructor parameter, or
* The `KRISP_VIVA_VAD_MODEL_PATH` environment variable

## Constructor Parameters

<ParamField path="model_path" type="str" default="None">
  Path to the Krisp model file (`.kef` extension). If not provided, uses the
  `KRISP_VIVA_VAD_MODEL_PATH` environment variable.
</ParamField>

<ParamField path="frame_duration" type="int" default="10">
  Frame duration in milliseconds. Must be 10, 15, 20, 30, or 32ms.
</ParamField>

<ParamField path="sample_rate" type="int" default="None">
  Audio sample rate in Hz. Must be 8000, 16000, 32000, 44100, or 48000.
</ParamField>

<ParamField path="params" type="VADParams" default="VADParams()">
  Voice Activity Detection parameters object

  <Expandable title="properties">
    <ParamField path="confidence" type="float" default="0.7">
      Confidence threshold for speech detection. Higher values make detection more strict. Must
      be between 0 and 1.
    </ParamField>

    <ParamField path="start_secs" type="float" default="0.2">
      Time in seconds that speech must be detected before transitioning to SPEAKING state.
    </ParamField>

    <ParamField path="stop_secs" type="float" default="0.2">
      Time in seconds of silence required before transitioning back to QUIET state.
    </ParamField>

    <ParamField path="min_volume" type="float" default="0.6">
      Minimum audio volume threshold for speech detection. Must be between 0 and 1.
    </ParamField>
  </Expandable>
</ParamField>

## Usage Example

```python theme={null}
from pipecat.audio.vad.krisp_viva_vad import KrispVivaVadAnalyzer
from pipecat.audio.vad.vad_analyzer import VADParams

context = LLMContext(messages)
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
    context,
    user_params=LLMUserAggregatorParams(
        vad_analyzer=KrispVivaVadAnalyzer(
            model_path="/path/to/model.kef",
            params=VADParams(stop_secs=0.2)
        ),
    ),
)
```

## Technical Details

### Sample Rate Requirements

The analyzer supports five sample rates:

* 8000 Hz
* 16000 Hz
* 32000 Hz
* 44100 Hz
* 48000 Hz

### Model Requirements

* Model files must have a `.kef` extension
* Model path can be specified via constructor or environment variable
* Model is loaded once during initialization

## Notes

* High-accuracy speech detection using Krisp VIVA SDK
* Supports multiple sample rates (8kHz to 48kHz)
* Requires external `.kef` model file
* Thread-safe for pipeline processing
* Automatic session management
* Configurable frame duration
