pyrnnoise
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
Metadata
Release files for pyrnnoise 0.4.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| pyrnnoise-0.4.6-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for pyrnnoise-0.4.6-py3-none-win_amd64.whl |
| pyrnnoise-0.4.6-py3-none-manylinux2014_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details for pyrnnoise-0.4.6-py3-none-manylinux2014_aarch64.whl |
| pyrnnoise-0.4.6-py3-none-manylinux1_x86_64.whl | Python 3 | none | Linux glibc 2.5+ x86-64 | Details for pyrnnoise-0.4.6-py3-none-manylinux1_x86_64.whl |
| pyrnnoise-0.4.6-py3-none-macosx_26_0_universal2.whl | Python 3 | none | macOS 26.0+ universal2 (ARM64, x86-64) | Details for pyrnnoise-0.4.6-py3-none-macosx_26_0_universal2.whl |
Total release size: 53.2 MB
Release files / pyrnnoise-0.4.6-py3-none-win_amd64.whl
| Download URL | pyrnnoise-0.4.6-py3-none-win_amd64.whl |
|---|---|
| Size | 13.3 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f34c07815581e110a84e820e7abf452578ad6d2d8af4b4178e2541d247e2d634
|
|
BLAKE2b-256 checksum How to use checksums |
e3a0d15da42873e1a8474c9147de59845345ba91e495e6a2f505dfd30d39cfde
|
| 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.6-py3-none-manylinux2014_aarch64.whl
| Download URL | pyrnnoise-0.4.6-py3-none-manylinux2014_aarch64.whl |
|---|---|
| Size | 13.3 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
30f5246645b7f9a48ee98a6fcf711876b576dc1c63eaf03afee864bcb61623c0
|
|
BLAKE2b-256 checksum How to use checksums |
2339cb6f57478c4efeddbf01b942f1f440453db68ae67fb93a03aa4730d08ee1
|
| 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.6-py3-none-manylinux1_x86_64.whl
| Download URL | pyrnnoise-0.4.6-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 |
60a4819f4f1d1160c853846c3f88dd33d4378fd0cd1b273a35067a62a02a12ce
|
|
BLAKE2b-256 checksum How to use checksums |
4861640fbfdcc3cb140bac9e9e68764d0b9c92719c900f8c5a8e51371cbae26b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / pyrnnoise-0.4.6-py3-none-macosx_26_0_universal2.whl
| Download URL | pyrnnoise-0.4.6-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 |
6110acdbb1aa992fc4122cc5a23d8efa07553abca9cd867c11cb2a64c94f73e8
|
|
BLAKE2b-256 checksum How to use checksums |
b4e56c85b7d8aaee8e04f730fdbd8295f1d3e5d6dcfb5c1cf8f8b7b22a1fccc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Security for pyrnnoise 0.4.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.