SoundFile
Read and write WAV/FLAC/OGG and other formats via libsndfile, returning NumPy arrays.
| Language | Python |
|---|---|
| Category | Synthesis & DSP |
| License | BSD-3-Clause |
| Platforms | macOS Windows Linux |
| Install | pip install soundfile |
| First released | 2013 |
| Maintained | Yes |
| Links | Website · Source |
Strengths
- Reliable read/write of many formats via libsndfile
- Returns and accepts NumPy arrays directly
- Block-wise streaming for large files
Limitations
- Format support bounded by libsndfile
- File I/O only; no playback or DSP
Best for
Loading and saving audio files as NumPy data in analysis and DSP pipelines.
Minimal example
import soundfile as sf
data, samplerate = sf.read("input.wav")
sf.write("output.flac", data, samplerate)