Metadata-Version: 2.4
Name: dfnstream-py
Version: 0.2.1
Summary: Real-time audio denoising using DeepFilterNet with streaming
Project-URL: Homepage, https://github.com/outspeed-ai/dfnstream-py
Project-URL: Repository, https://github.com/outspeed-ai/dfnstream-py
Project-URL: Issues, https://github.com/outspeed-ai/dfnstream-py/issues
Author-email: Sayan Jyoti Das <sayanjyotidasworkmail@gmail.com>
License: MIT
License-File: LICENSE
Keywords: audio,deepfilternet,denoising,real-time,streaming
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Requires-Dist: numpy<2.3,>=1.24
Requires-Dist: onnxruntime>=1.22.0
Description-Content-Type: text/markdown

# 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

```bash
pip install dfnstream-py
```

## Quick Start

```python
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
```bash
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
```bash
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.

```python
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