Skip to main content

Real-time audio denoising using DeepFilterNet with streaming

Project description

DeepFilterNet Streaming

A Python library for real-time audio denoising using DeepFilterNet, providing streaming audio processing capabilities through C API bindings.

Platform Support

Currently supports the following platforms:

  • macOS ARM64 (Apple Silicon)
  • Linux x86_64
  • Linux ARM64 (aarch64)

Installation

pip install dfnstream-py

Quick Start

from dfnstream_py import DeepFilterNetStreaming
import numpy as np

# Initialize the processor
processor = DeepFilterNetStreaming()

# Process audio chunks
audio_chunk = np.random.randn(1024).astype(np.float32)  # Your audio data
denoised_chunk = processor.process_chunk(audio_chunk)

# Don't forget to cleanup
processor.close()

Examples

The examples/ folder contains sample scripts demonstrating different use cases:

Single File Processing

uv run python examples/enhance_wav.py input_audio.wav

Processes a single WAV file and saves the denoised version as input_audio_denoised.wav.

Batch Directory Processing

uv run python examples/enhance_dir.py /path/to/wav/files/

Processes all WAV files in a directory and saves enhanced versions to an outputs/ folder.

API Reference

DeepFilterNetStreaming

The main class for audio processing.

DeepFilterNetStreaming(
    model_path=None,          # Optional custom model path
    atten_lim=None,           # Attenuation limit in dB (None = no limit)
    log_level="warn",         # Logging level: "error", "warn", "info", "debug", "trace"
    compensate_delay=True,    # Enable delay compensation
    post_filter_beta=0.0      # Post-filter beta (0.0 = disabled)
)

Key Methods

  • process_chunk(audio_chunk) - Process a chunk of audio data
  • process_frame(audio_frame) - Process a single frame
  • finalize() - Get remaining delayed samples
  • close() - Clean up resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dfnstream_py-0.1.0.tar.gz (78.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dfnstream_py-0.1.0-py3-none-any.whl (78.7 MB view details)

Uploaded Python 3

File details

Details for the file dfnstream_py-0.1.0.tar.gz.

File metadata

  • Download URL: dfnstream_py-0.1.0.tar.gz
  • Upload date:
  • Size: 78.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for dfnstream_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bfc9d276826299447158f90f144d9c7f1a8f6827378f33df2c770cc7739e6c8f
MD5 ef2b108d76e0fd61fe0de6488dc5599f
BLAKE2b-256 dc543c34757fb571b522ab001cbda73488f571992d68e7f81f522229f9ece898

See more details on using hashes here.

File details

Details for the file dfnstream_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dfnstream_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 78.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for dfnstream_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad5c3189d24f5dafe40935d2e1d1dedb96037e88524513c1b72a3ff08cb09687
MD5 21ed0c81cb633e29f0a5dd2a66cd9c1f
BLAKE2b-256 58fd34890d63aa6bebea6841842f73e6ac7e0c1db364270c0bdc3b9f37176816

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page