Remove/reduce librosa dependencies
I was getting annoyed with slow (5 sec) import speeds for ketos audio modules, so I investigated the matter and found that librosa was taking over 5 seconds to import!
I was able to remove some librosa dependencies, using soundfile instead for determining file duration and sampling rate (without loading the entire audio data content into memory).
However, some librosa dependencies remain. In particular,
- resampling in Waveform module
- cqt function in misc module
- spec2wave function in misc module
still depend on librosa. For now, I have moved the imports to within these functions so that librosa only gets imported when/if these functions are callled.
As a next step, I would suggest we try to reimplement resampling with a different library, e.g., perhaps scipy?
This is the import speed profiling after the changes:
Much nicer.
@bpadovese , please have a look at this when you have time. We can either merge this already, or continue working on the resampling stuff before merging.