diart icon indicating copy to clipboard operation
diart copied to clipboard

Switch to a faster library for dynamic resampling

Open juanmc2005 opened this issue 2 years ago • 1 comments

Looks like torchaudio.Resample is not very fast compared to other libraries implementing resampling in python.

See https://github.com/jonashaag/audio-resampling-in-python

Looks like we could switch to soxr and get a 10x speed increase.

juanmc2005 avatar Oct 24 '23 09:10 juanmc2005

hi Juan. I found a cheap way to avoid resampling if you're using pipewire is to force the rate with

pw-metadata -n settings 0 clock.force-rate 16000

that's for microphone reording.

There's also an aubio library which provides resampling. It provides a python module

https://aubio.org/doc/latest/synth_2test-sampler_8c-example.html

pnocera avatar Oct 28 '23 15:10 pnocera