Overview

KrispFilter is an audio processor that reduces background noise in real-time audio streams using Krisp AI technology. It inherits from BaseAudioFilter and processes audio frames to improve audio quality by removing unwanted noise.

To use Krisp, you need a Krisp SDK license. Get started at Krisp.ai.

Looking for help getting started with Krisp and Pipecat? Checkout our Krisp noise cancellation guide.

Installation

The Krisp filter requires additional dependencies:

pip install pipecat-ai[krisp]

Environment Variables

You need to provide the path to the Krisp model. This can either be done by setting the KRISP_MODEL_PATH environment variable or by setting the model_path in the constructor.

Constructor Parameters

sample_type
str
default: "PCM_16"

Audio sample type format

channels
int
default: "1"

Number of audio channels

model_path
str
default: "None"

Path to the Krisp model file.

You can set the model_path directly. Alternatively, you can set the KRISP_MODEL_PATH environment variable to the model file path.

Input Frames

AudioRawFrame
Frame
required

Raw audio data for noise reduction processing

FilterControlFrame
Frame

Control frames to enable/disable filtering

FilterEnableFrame
Frame

Specific control frame to toggle filtering on/off

# Disable noise reduction
await task.queue_frame(FilterEnableFrame(False))

# Re-enable noise reduction
await task.queue_frame(FilterEnableFrame(True))

Output Frames

AudioRawFrame
Frame

Processed audio data with reduced background noise

Usage Example

transport = DailyTransport(
    room_url,
    token,
    "Respond bot",
    DailyParams(
        audio_in_filter=KrispFilter(), # Enable Krisp noise reduction
        audio_out_enabled=True,
        vad_enabled=True,
        vad_analyzer=SileroVADAnalyzer(),
        vad_audio_passthrough=True,
    ),
)

Frame Flow

Notes

  • Requires Krisp SDK and model file to be available
  • Supports real-time audio processing
  • Supports additional features like background voice removal
  • Handles PCM_16 audio format
  • Thread-safe for pipeline processing
  • Can be dynamically enabled/disabled
  • Maintains audio quality while reducing noise
  • Efficient processing for low latency