Loading fragments of file is slow in newer version
See original GitHub issueDescribe the bug Loading a piece of a longer audio file is much slower in v0.9.2 than it was in v0.8.1. For instance, loading a 2-hour wav file takes 440 ms, and loading the first 5 seconds using librosa 0.8.1 only takes about 1 ms. However, in the 0.9.2 package version, loading the first 5 seconds is taking about 130 ms.
Apologies if this is a duplicate issue, I have not found a similar one when searching the issues.
To Reproduce
import librosa
from time import time
t=time()
librosa.load('two_hour_file.wav')
print(time()-t) # 440 ms, good
t=time()
librosa.load('two_hour_file.wav',offset=0,duration=2)
print(time()-t) # 130 ms, slow!
Expected behavior Loading a short piece of audio should be very fast, as it was in previous package versions.
Software versions
Linux-5.15.0-43-generic-x86_64-with-glibc2.17
Python 3.8.13 (default, Mar 28 2022, 11:38:47)
[GCC 7.5.0]
NumPy 1.22.0
SciPy 1.9.0
librosa 0.9.2
INSTALLED VERSIONS
------------------
python: 3.8.13 (default, Mar 28 2022, 11:38:47)
[GCC 7.5.0]
librosa: 0.9.2
audioread: 2.1.9
numpy: 1.22.0
scipy: 1.9.0
sklearn: 1.1.2
joblib: 1.1.0
decorator: 5.1.1
soundfile: 0.10.3
resampy: 0.3.1
numba: 0.56.0
pooch: v1.6.0
packaging: 21.3
numpydoc: None
sphinx: None
sphinx_rtd_theme: None
sphinx_multiversion: None
sphinx_gallery: None
mir_eval: None
ipython: None
sphinxcontrib-svg2pdfconverter: None
pytest: None
pytest-mpl: None
pytest-cov: None
matplotlib: 3.5.2
samplerate: None
soxr: None
contextlib2: installed, no version number available
presets: None
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How to improve fragment loading speed? - android
I'm using a very hackish but effective way in my application, but it works good. My mapFragment is not displayed right after the...
Read more >Has anyone else noticed slow loading fragments cause ...
What I wish would happen is when a fragment starts coming in so slowly, if would just bail out after a few seconds...
Read more >Ways to improve your computer's performance
Fragmentation makes your hard disk do extra work that can slow down your computer. Removable storage devices such as USB flash drives can...
Read more >Slow rendering
On recent versions of Android, it's one of the most common reasons for the UI Thread to stop running. Generally, the fix is...
Read more >20 Ways To Speed Up A Slow WooCommerce Site (2022 ...
1. Use cloud hosting with Cloudflare Enterprise which is the easiest way to improve TTFB and the #1 speed factor (including WooCommerce sites)....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes I can confirm that with
audioread==3.0.0
the audio loading times are the fast for bothlibrosa==0.9.2
andlibrosa==0.9.1
.https://github.com/beetbox/audioread/pull/126 is merged and should fix this issue for you, if you’re willing to run on a development version of audioread.scratch that, audioread 3.0 is out, so no dev install necessary! Let me know if this resolves things for you and we can close this issue out.