# Source: https://docs.pipecat.ai/guides/features/krisp.md

# Noise cancellation with Krisp

> Learn how to integrate Krisp noise cancellation into your Pipecat application

<Warning>
  The `KrispFilter` is deprecated and will be removed in a future version.
  Please use the `KrispVivaFilter`, which is the latest model from Krisp. See
  the [Krisp VIVA guide](/guides/features/krisp-viva) for more information.
</Warning>

## Overview

This guide will walk you through setting up and using Krisp's noise reduction capabilities in your Pipecat application. Krisp provides professional-grade noise cancellation that can significantly improve audio quality in real-time communications.

To use Krisp's noise cancellation, you'll need to obtain their SDK and models through a Krisp developer account. Our Pipecat Krisp module simplifies the integration process, which we'll cover in this guide.

## Walkthrough

### Get Access to Krisp SDK and Models

1. Create a Krisp developers account at [krisp.ai/developers](https://krisp.ai/developers)
2. Download the [Krisp Desktop SDK (v7)](https://sdk.krisp.ai/sdk/desktop) that matches your platform:
   * Linux: `Desktop SDK v7.0.2: Linux`
   * macOS (ARM): `Desktop SDK v7.0.1: Mac ARM`
   * macOS (Intel): `Desktop SDK v7.0.1: Mac Intel`
   * Windows(ARM): `Desktop SDK v7.0.2: Windows ARM`
   * Windows (x64): `Desktop SDK v7.0.2: Windows`
3. Download the corresponding models. We recommend trying the `Background Voice Cancellation` model. Recommended model for each platform:
   * Linux (ARM): `hs.c6.f.s.de56df.kw`
   * Mac (ARM): `hs.c6.f.s.de56df.kw`
   * Linux (x86\_64): `hs.c6.f.s.de56df.kw`
   * Mac (x86\_64): `hs.c6.f.s.de56df.kw`
   * Windows (x86\_64): `hs.c6.f.s.de56df.kw`

<Frame><img src="https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/krisp-portal.png?fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=5dc5cd957815ebaac7c0a95bd6fc5746" alt="Krisp SDK Portal" data-og-width="2802" width="2802" data-og-height="2348" height="2348" data-path="images/krisp-portal.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/krisp-portal.png?w=280&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=a5a71131093407c0f73ba9c577f6e2bd 280w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/krisp-portal.png?w=560&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=bed7afb172e3db79d4886d74e7ada182 560w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/krisp-portal.png?w=840&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=165a851cb70505988eadaba352b43fcc 840w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/krisp-portal.png?w=1100&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=b6290177c64d4a7af7e4947b83cc135a 1100w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/krisp-portal.png?w=1650&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=d9a18f3a2dcb9684e9154a7712cb622f 1650w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/krisp-portal.png?w=2500&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=0253d0235e27a1590b37d0a1eb25b808 2500w" /></Frame>

### Install build dependencies

The `pipecat-ai-krisp` module is a python wrapper around Krisp's C++ SDK. To build the module, you'll need to install the following dependencies:

<Tabs>
  <Tab title="macOS">
    ```bash  theme={null}
    # Using Homebrew
    brew install cmake pybind11
    ```
  </Tab>

  <Tab title="Ubuntu/Debian">
    ```bash  theme={null}
    # Using apt
    sudo apt-get update
    sudo apt-get install cmake python3-dev pybind11-dev g++
    ```
  </Tab>

  <Tab title="Windows">
    ```powershell  theme={null}
    # Using Chocolatey
    choco install cmake
    # pybind11 will be installed via pip during the build process

    # OR using Visual Studio
    # 1. Install Visual Studio with C++ development tools
    # 2. Install CMake from https://cmake.org/download/
    # pybind11 will be installed via pip during the build process
    ```
  </Tab>
</Tabs>

<Note>
  For Windows users: Make sure you have Visual Studio installed with C++
  development tools, or alternatively, have the Visual C++ Build Tools
  installed.
</Note>

### Install the pipecat-ai-krisp module

In your Pipecat repo, activate your virtual environment:

<Tabs>
  <Tab title="macOS/Linux">
    ```bash  theme={null}
    python3 -m venv venv
    source venv/bin/activate
    ```
  </Tab>

  <Tab title="Windows">
    ```powershell  theme={null}
    # Using PowerShell
    python -m venv venv
    .\venv\Scripts\Activate.ps1

    # OR using Command Prompt
    python -m venv venv
    .\venv\Scripts\activate.bat

    # OR using Git Bash
    python -m venv venv
    source venv/Scripts/activate
    ```
  </Tab>
</Tabs>

Export the path to your Krisp SDK and model files:

<Tabs>
  <Tab title="macOS/Linux">
    ```bash  theme={null}
    # Add to your .env file or shell configuration
    export KRISP_SDK_PATH=/PATH/TO/KRISP/SDK
    export KRISP_MODEL_PATH=/PATH/TO/KRISP/MODEL.kef
    ```
  </Tab>

  <Tab title="Windows">
    ```powershell  theme={null}
    # Using PowerShell
    $env:KRISP_SDK_PATH = "C:\PATH\TO\KRISP\SDK"
    $env:KRISP_MODEL_PATH = "C:\PATH\TO\KRISP\MODEL.kef"

    # OR using Command Prompt
    set KRISP_SDK_PATH=C:\PATH\TO\KRISP\SDK
    set KRISP_MODEL_PATH=C:\PATH\TO\KRISP\MODEL.kef
    ```
  </Tab>
</Tabs>

<Tip>
  When selecting a `KRISP_MODEL_PATH`, ensure that you're selecting the actual
  model file, not just the directory. The path should look something like this:

  <Tabs>
    <Tab title="ARM Linux">
      ```bash  theme={null}
      export KRISP_MODEL_PATH=./krisp/hs.c6.f.s.de56df.kw
      ```
    </Tab>

    <Tab title="Mac ARM">
      ```bash export theme={null}
      KRISP_MODEL_PATH=./krisp/outbound-bvc-models-fp16/hs.c6.f.s.de56df.bucharest.kef
      ```
    </Tab>

    <Tab title="Windows">
      ```powershell  theme={null}
      $env:KRISP_MODEL_PATH="C:\krisp\outbound-bvc-models-fp32\hs.c6.f.s.de56df.bucharest.kef"
      ```
    </Tab>
  </Tabs>
</Tip>

Next, install the `pipecat-ai[krisp]` module, which will automatically build the `pipecat-ai-krisp` python wrapper module:

```bash  theme={null}
pip install "pipecat-ai[krisp]"
```

### Test the integration

You can now test the Krisp integration. The easiest way to do this is to run the foundational example: [07p-interruptible-krisp.py](https://github.com/pipecat-ai/pipecat/blob/main/examples/foundational/07p-interruptible-krisp.py).

<Tip>
  You can run a foundational example by running the following command:

  ```bash  theme={null}
  python examples/foundational/07p-interruptible-krisp.py -u YOUR_DAILY_ROOM_URL
  ```
</Tip>

#### Important for macOS users

If you're running on macOS you may receive a security warning about running the script. This is expected. You can allow access by going to `System Settings > Privacy & Security` then click `Allow Anyway` to permit the example to run.

<Frame><img src="https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/allow-krisp.png?fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=a93947edd11c47b2e1be8879a35e8284" alt="Security & Privacy" data-og-width="1654" width="1654" data-og-height="1474" height="1474" data-path="images/allow-krisp.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/allow-krisp.png?w=280&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=c2d115817943bc4689fa31a3e00c18a9 280w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/allow-krisp.png?w=560&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=2c1c9cba0cc342070c3d19d74e038982 560w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/allow-krisp.png?w=840&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=96bfd405f776480b4f1ee8f12916f249 840w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/allow-krisp.png?w=1100&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=ef7019662e66a027a44d74bf812f591a 1100w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/allow-krisp.png?w=1650&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=080f04365097880083f4d8bcda2dfdbb 1650w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/allow-krisp.png?w=2500&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=353d57481f15078b24d8f44ae46683f7 2500w" /></Frame>

After allowing and re-running, you may get a pop-up asking for permission. Select `Open Anyway` to run the script.

<Frame><img src="https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/open-anyway-krisp.png?fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=6aeec83402972fb028e23a053d12d200" alt="Open Anyway" data-og-width="744" width="744" data-og-height="912" height="912" data-path="images/open-anyway-krisp.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/open-anyway-krisp.png?w=280&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=e2132b4a915c4e9b05bdd8f76985bd9b 280w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/open-anyway-krisp.png?w=560&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=4cd16fb3141cc97629aa650def4ec8eb 560w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/open-anyway-krisp.png?w=840&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=23d79f2041851fe136fe7296460bd46b 840w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/open-anyway-krisp.png?w=1100&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=3fdceddc530a82a15eb7fe52fbd9c05f 1100w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/open-anyway-krisp.png?w=1650&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=2cad0cfb25587da019f7803976037f86 1650w, https://mintcdn.com/daily/PVk58z7DekUaD0vv/images/open-anyway-krisp.png?w=2500&fit=max&auto=format&n=PVk58z7DekUaD0vv&q=85&s=93ee05306a137495afbc09e5eff71a3c 2500w" /></Frame>

## Usage Example

Here's a basic example of how to add Krisp noise reduction to your Pipecat pipeline:

```python  theme={null}
from pipecat.audio.filters.krisp_filter import KrispFilter
from pipecat.transports.services.daily import DailyParams, DailyTransport

# Add to transport configuration
transport = DailyTransport(
    room_url,
    token,
    "Audio Bot",
    DailyParams(
        audio_in_filter=KrispFilter(),  # Enable Krisp noise reduction
        audio_in_enabled=True,
        audio_out_enabled=True,
        vad_analyzer=SileroVADAnalyzer(),
    ),
)
```

## Troubleshooting

Common issues and solutions:

1. **Missing Dependencies**

```bash  theme={null}
Error: Missing module: pipecat_ai_krisp
```

Solution: Ensure you've installed with the krisp extra: `pip install "pipecat-ai[krisp]"`

2. **Model Path Not Found**

```bash  theme={null}
Error: Model path for KrispAudioProcessor must be provided
```

Solution: Set the `KRISP_MODEL_PATH` environment variable or provide it in the constructor

3. **SDK Path Issues**

```bash  theme={null}
Error: Cannot find Krisp SDK
```

Solution: Verify `KRISP_SDK_PATH` points to a valid Krisp SDK installation

## Additional Resources

* [KrispFilter Reference Documentation](/server/utilities/audio/krisp-filter)
* [Example Application](https://github.com/pipecat-ai/pipecat/blob/main/examples/foundational/07p-interruptible-krisp.py)


---

> To find navigation and other pages in this documentation, fetch the llms.txt file at: https://docs.pipecat.ai/llms.txt