Skip to main content

Overview

KrispVivaFilter is an audio processor that reduces background noise in real-time audio streams using Krisp VIVA SDK. It inherits from BaseAudioFilter and processes audio frames to improve audio quality by removing unwanted noise using Krisp’s proprietary noise suppression algorithms. 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

See the Krisp guide to learn how to install the Krisp VIVA SDK.

Environment Variables

You need to provide the path to the Krisp model file (.kef extension). This can either be done by setting the KRISP_VIVA_MODEL_PATH environment variable or by setting the model_path in the constructor.

Constructor Parameters

model_path
str
default:"None"
Path to the Krisp model file (.kef extension).You can set the model_path directly. Alternatively, you can set the KRISP_VIVA_MODEL_PATH environment variable to the model file path.
noise_suppression_level
int
default:"100"
Noise suppression level for the filter

Supported Sample Rates

The filter supports the following sample rates:
  • 8000 Hz
  • 16000 Hz
  • 24000 Hz
  • 32000 Hz
  • 44100 Hz
  • 48000 Hz

Input Frames

FilterEnableFrame
Frame
Specific control frame to toggle filtering on/off
from pipecat.frames.frames import FilterEnableFrame

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

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

Usage Example

from pipecat.audio.filters.krisp_viva_filter import KrispVivaFilter
from pipecat.transports.daily.transport import DailyParams, DailyTransport

transport = DailyTransport(
    room_url,
    token,
    "Respond bot",
    DailyParams(
        audio_in_enabled=True,
        audio_in_filter=KrispVivaFilter(), # Enable Krisp noise reduction
        audio_out_enabled=True,
        vad_analyzer=SileroVADAnalyzer(),
    ),
)
I