Skip to main content

Overview

RNNoiseFilter is an audio processor that reduces background noise in real-time audio streams using RNNoise, a recurrent neural network for audio noise reduction. It inherits from BaseAudioFilter and processes audio frames via the pyrnnoise library. RNNoise is a free, open-source noise suppression solution that requires no API keys or external services.

Installation

The RNNoise filter requires additional dependencies:
pip install "pipecat-ai[rnnoise]"

Constructor Parameters

resampler_quality
str
default:"\"QQ\""
Quality of the internal resampler used when the transport sample rate differs from 48kHz. One of "VHQ" (Very High Quality), "HQ" (High Quality), "MQ" (Medium Quality), "LQ" (Low Quality), or "QQ" (Quick). Defaults to "QQ" for lowest latency.

Input Frames

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

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

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

Usage Example

from pipecat.audio.filters.rnnoise_filter import RNNoiseFilter
from pipecat.transports.services.daily import DailyTransport, DailyParams

transport = DailyTransport(
    room_url,
    token,
    "Respond bot",
    DailyParams(
        audio_in_enabled=True,
        audio_in_filter=RNNoiseFilter(),  # Enable RNNoise noise suppression
        audio_out_enabled=True,
    ),
)

Notes

  • No API key or external service required (fully local processing)
  • RNNoise operates at 48kHz internally; automatic resampling is applied for other sample rates
  • Handles 16-bit PCM audio format
  • Can be dynamically enabled/disabled via FilterEnableFrame
  • Buffers audio to match RNNoise’s required frame length (480 samples)
  • When resampling is needed, uses SOXR (install with pip install "pipecat-ai[soxr]")