Comparison of audio resampling libraries and some audio loaders.
View the two notebooks:
Downsampling from 48 kHz to 44.1 kHz.
Library | Time on CPU |
---|---|
torchaudio_hann |
0.87 ms |
torchaudio_transform_hann |
1.11 ms |
torchaudio_transform_kaiser |
1.38 ms |
soxr |
1.43 ms |
torchaudio_kaiser |
1.69 ms |
scipy |
2.40 ms |
julius |
9.21 ms |
resampy_fast |
13.63 ms |
nnresample |
18.33 ms |
resampy_best |
38.04 ms |
Load Library | Resampling Library | Time on CPU |
---|---|---|
torchaudio-sox_io |
torchaudio_hann |
26.42 ms |
torchaudio-soundfile |
torchaudio_hann |
27.05 ms |
torchaudio-sox_io |
torchaudio_kaiser |
27.65 ms |
torchaudio-soundfile |
torchaudio_kaiser |
27.15 ms |
scipy |
soxr |
28.06 ms |
torchaudio-sox_io |
soxr |
37.96 ms |
torchaudio-soundfile |
soxr |
38.00 ms |
torchaudio-soundfile |
julius |
39.17 ms |
librosa |
soxr |
39.24 ms |
soundfile |
soxr |
42.83 ms |
- according to the original notebook Audio-resampling-in-python
- Good:
scikit.samplerate
/scikits-samplerate
/samplerate
/libsamplerate
librosa
/resampy
("kaiser_best"
)julius
- Acceptable:
nnresample
lilfilter
torchaudio
(transforms.Resample
+resample_waveform
)librosa
/resampy
("kaiser_fast"
)
- Bad:
scipy.signal.resample
Please check plots in the Audio Resampling in Python.ipynb notebook. This version is an updated version of the original notebook but does not have all the libraries tested in the original notebook.