Skip to main content

pyrnnoise

PyPI License

Python bindings for RNNoise, a recurrent neural network for audio noise reduction.

Features

  • Real-time noise suppression for speech audio
  • Command-line interface for processing audio files
  • Supports mono and stereo audio files
  • Visualize voice activity detection probabilities

Installation

pip install pyrnnoise

Usage

Command-line interface

# Basic usage
denoise input.wav output.wav

# With voice activity detection plot
denoise input.wav output.wav --plot

Python API

from pyrnnoise import RNNoise

# Create denoiser instance
denoiser = RNNoise(sample_rate=48000)

# Process audio file
for speech_prob in denoiser.denoise_wav("input.wav", "output.wav"):
    print(f"Processing frame with speech probability: {speech_prob}")

Advanced Usage

The RNNoise class provides several methods for processing audio at different levels:

  • denoise_frame(frame, partial=False): Process a single audio frame (480 samples at 48kHz)

    • Returns a tuple of (speech_probabilities, denoised_frame)
    • speech_probabilities: Voice activity detection probabilities for each channel
    • denoised_frame: The denoised audio frame
  • denoise_chunk(chunk, partial=False): Process a chunk of audio data

    • Takes a numpy array of audio samples [num_channels, num_samples]
    • Yields tuples of (speech_probabilities, denoised_frame) for each frame
    • Useful for processing audio streams or large audio files in chunks

Example using denoise_chunk:

import numpy as np
from pyrnnoise import RNNoise

# Create denoiser instance
denoiser = RNNoise(sample_rate=48000)

# Generate or load some audio data (stereo in this example)
audio_data = np.random.randint(-32768, 32767, (2, 48000), dtype=np.int16)

# Process audio chunk
for speech_prob, denoised_audio in denoiser.denoise_chunk(audio_data):
    print(f"Speech probability: {speech_prob}")
    # Process denoised_audio as needed

Build from source

# Clone with submodules
git submodule update --init

# Build RNNoise library
cmake -B pyrnnoise/build -DCMAKE_BUILD_TYPE=Release
cmake --build pyrnnoise/build --target install

# Install Python package in development mode
pip install -e .

License

Apache License 2.0

Metadata

Release files for pyrnnoise 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pyrnnoise 0.4.4
File
pyrnnoise-0.4.4-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
pyrnnoise-0.4.4-py3-none-manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
pyrnnoise-0.4.4-py3-none-manylinux1_x86_64.whl Python 3 none Linux glibc 2.5+ x86-64 Details
pyrnnoise-0.4.4-py3-none-macosx_26_0_universal2.whl Python 3 none macOS 26.0+ universal2 (ARM64, x86-64) Details

Total release size: 53.2 MB

Release files / pyrnnoise-0.4.4-py3-none-win_amd64.whl

Download URL pyrnnoise-0.4.4-py3-none-win_amd64.whl
Size 13.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b09e2b1fe26276598cbfd347bceef1c68a19e49b8139f57190b4dd0b3a299c4c
BLAKE2b-256 checksum
How to use checksums
6700f6fab78a3fb96945b5178b74f702816d51815a059dedadf50710d1b222c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / pyrnnoise-0.4.4-py3-none-manylinux2014_aarch64.whl

Download URL pyrnnoise-0.4.4-py3-none-manylinux2014_aarch64.whl
Size 13.3 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
12de868a7dcdaedfe333d09fa9953494888eaaa1337ddcb8e7d8433859212839
BLAKE2b-256 checksum
How to use checksums
b0d8bc997d4452edb321b8052c978257014fd26ca550f515b3d6aea5f62bd1ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyrnnoise-0.4.4-py3-none-manylinux1_x86_64.whl

Download URL pyrnnoise-0.4.4-py3-none-manylinux1_x86_64.whl
Size 13.3 MB
Tags Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
d4b348ba695b42eaa35240453d19022894160823696606428ae88a2b3a50dd97
BLAKE2b-256 checksum
How to use checksums
77355f64ce13ce8a36a44453c928261f0c0ed8cf027b727275253e196c74ac22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyrnnoise-0.4.4-py3-none-macosx_26_0_universal2.whl

Download URL pyrnnoise-0.4.4-py3-none-macosx_26_0_universal2.whl
Size 13.4 MB
Tags Python 3 macOS 26.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
74294a83bc70ecc77338a343a613dc34bfad3233d029fa3465484e9ef19d0918
BLAKE2b-256 checksum
How to use checksums
b0e2b3ac24942ffff9b0f4242ad66da7e229e0473b2d3cc17b0ba754412911ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.4.5

4 release files

This release

0.4.4 This release

4 release files

0.4.3

4 release files

0.4.2

2 release files

0.4.1

3 release files

0.4.0

3 release files

0.3.9

3 release files

0.3.8

3 release files

0.3.7

3 release files

0.3.6

3 release files

0.3.5

3 release files

0.3.4

3 release files

0.3.3

3 release files

0.3.2

3 release files

0.2.7

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page