kyutai-labs / sphn

python bindings for symphonia/opus - read various audio formats from python and write opus files
Apache License 2.0
22 stars 2 forks source link

sphn

Python bindings for the symphonia and opus crates.

Installation

The python wheels are available on pypi.

pip install sphn

Usage

Download some sample audio file.

wget https://github.com/metavoiceio/metavoice-src/raw/main/assets/bria.mp3
import sphn

# Read an audio file
data, sample_rate = sphn.read("bria.mp3")
print(data.shape, sample_rate)

# Save as wav
sphn.write_wav("bria.wav", data[0], sample_rate)