semvec/pypi-packages huggingface dataset:
speexdsp-ns-vulcanlabs 0.1.3
Python bindings of speexdsp noise suppression library (Vulcanlabs fork with multi-platform wheels)
License: BSD-3-Clause
Requires Python: >=3.8
Keywords: speexdsp, noise suppression, audio processing, speech enhancement

# speexdsp-ns-vulcanlabs

Python bindings for SpeexDSP noise suppression library with **pre-built wheels** for multiple platforms.

This is a fork of [TeaPoly/speexdsp-ns-python](https://github.com/TeaPoly/speexdsp-ns-python) with added support for:
- ✅ Linux x86_64
- ✅ Linux ARM64 (aarch64)
- ✅ macOS x86_64 (Intel)
- ✅ macOS ARM64 (Apple Silicon M1/M2/M3)
- ✅ Python 3.8 - 3.12

## Installation

```bash
pip install speexdsp-ns-vulcanlabs
```

## Usage

```python
from speexdsp_ns import NoiseSuppression

# Create noise suppression instance
# frame_size: number of samples per frame (e.g., 256)
# sample_rate: audio sample rate in Hz (e.g., 16000)
ns = NoiseSuppression.create(frame_size=256, sample_rate=16000)

# Process audio frame (must be bytes of int16 samples)
# Input: raw PCM audio bytes (frame_size * 2 bytes for int16)
# Output: noise-suppressed audio bytes
processed_audio = ns.process(raw_audio_bytes)
```

### Example: Process WAV file

```python
import wave
from speexdsp_ns import NoiseSuppression

frame_size = 256

# Open input file
with wave.open('input.wav', 'rb') as infile:
    sample_rate = infile.getframerate()
    
    # Create noise suppression
    ns = NoiseSuppression.create(frame_size, sample_rate)
    
    # Open output file
    with wave.open('output.wav', 'wb') as outfile:
        outfile.setnchannels(1)
        outfile.setsampwidth(2)  # 16-bit
        outfile.setframerate(sample_rate)
        
        while True:
            data = infile.readframes(frame_size)
            if len(data) != frame_size * 2:
                break
            
            # Process frame
            processed = ns.process(data)
            outfile.writeframes(processed)
```

## Requirements

- Python 3.8+
- No additional system dependencies required (pre-built wheels include speexdsp)

## Building from source

If you need to build from source:

```bash
# Linux (Ubuntu/Debian)
sudo apt-get install libspeexdsp-dev swig
pip install .

# macOS
brew install speexdsp swig
export LDFLAGS="-L$(brew --prefix speexdsp)/lib"
export CPPFLAGS="-I$(brew --prefix speexdsp)/include"
pip install .
```

## License

BSD-3-Clause License (same as original speexdsp-ns-python)

## Credits

- Original implementation: [TeaPoly/speexdsp-ns-python](https://github.com/TeaPoly/speexdsp-ns-python)
- SpeexDSP library: [xiph/speexdsp](https://github.com/xiph/speexdsp)
- Multi-platform wheels: [Vulcanlabs](https://github.com/hiendang7613vulcan/speexdsp-ns-vulcanlabs)