audiobenchmarkinglibrosapitch-shifting

Does torchlibrosa or librosa perform better for realtime audio processing?


I'm looking at doing some realtime audio processing (more specifically pitch shifting) - does Librosa or Torchlibrosa (https://github.com/qiuqiangkong/torchlibrosa) perform better at this in Python or what are some good benchmarks or algorithms to test this?

I know that Python isn't naturally suited to realtime applications, but I need to for this project. I am unsure of how to benchmark it quantitatively.


Solution

  • It looks like torchlibrosa is simply a recreation of librosa that can run on a GPU using pytorch, which is only useful if you're trying to process massive amounts of data (for example for training a neural network) So maybe a good starting question is, is your real-time project going to be running on a GPU? If not, then it probably makes sense to go with regular librosa.

    If you need a benchmark, you can find loads of examples online on benchmarking a python function in a short script. See how long the function you want takes using torchlibrosa, then do the same for the same function using librosa, and compare the times.