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
  2. Download the Krisp Desktop SDK that matches your platform:
    • Linux: krisp-audio-sdk-9.0.0-lin_x64-nc
    • macOS (ARM): krisp-audio-sdk-9.0.0-mac_arm64-nc
    • macOS (Intel): krisp-audio-sdk-9.0.0-mac_x64-nc
    • Windows: krisp-audio-sdk-9.0.0-win_x64-nc
  3. Download the corresponding models. We recommend trying the “Background Voice Cancellation” model.

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:

# Using Homebrew
brew install cmake pybind11

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

Install the pipecat-ai-krisp module

In your Pipecat repo, activate your virtual environment:

python3 -m venv venv
source venv/bin/activate

Export the path to your Krisp SDK and model files:

# 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

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:

export
KRISP_MODEL_PATH=./krisp/outbound-bvc-models-fp16/hs.c6.f.s.de56df.bucharest.kef

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

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.

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

python examples/foundational/07p-interruptible-krisp.py -u YOUR_DAILY_ROOM_URL

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.

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

Usage Example

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

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_out_enabled=True,
        vad_enabled=True,
        vad_analyzer=SileroVADAnalyzer(),
        vad_audio_passthrough=True,
    ),
)

Troubleshooting

Common issues and solutions:

  1. Missing Dependencies
Error: Missing module: pipecat_ai_krisp

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

  1. Model Path Not Found
Error: Model path for KrispAudioProcessor must be provided

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

  1. SDK Path Issues
Error: Cannot find Krisp SDK

Solution: Verify KRISP_SDK_PATH points to a valid Krisp SDK installation

Additional Resources