torchaudio
PyTorch's audio library: I/O, datasets, and transforms (spectrograms, MFCC) for audio ML.
| Language | Python |
|---|---|
| Category | Audio analysis |
| License | BSD-2-Clause |
| Platforms | macOS Windows Linux |
| Install | pip install torchaudio |
| First released | ~2018 |
| Maintained | Yes |
| Links | Website · Source |
Strengths
- Tight PyTorch integration, GPU-accelerated differentiable transforms
- Ships common datasets, feature extractors, pipelines
Limitations
- Now in maintenance mode: no new features
- 2.9 removed some deprecated APIs, breaking old code
Best for
Audio feature extraction and dataset/transform pipelines within PyTorch ML.
Minimal example
import torchaudio
wav, sr = torchaudio.load('audio.wav')
spec = torchaudio.transforms.MelSpectrogram()(wav)