error when loading the librosa example
See original GitHub issueDescription
When I tried to load the example audio of librosa following the example code provided, I encountered an error of division by 0.
Steps/Code to Reproduce
# I used the following code after importing librosa
filename = librosa.util.example_audio_file()
y, sr = librosa.load(filename)
y
# expected output: array([ -4.756e-06, -6.020e-06, ..., -1.040e-06, 0.000e+00], dtype=float32)
but I got the following error:
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
<ipython-input-58-51ccf84ebac8> in <module>()
----> 1 y, sr = librosa.load(filename)
/anaconda2/lib/python2.7/site-packages/librosa/core/audio.pyc in load(path, sr, mono, offset, duration, dtype, res_type)
158
159 if sr is not None:
--> 160 y = resample(y, sr_native, sr, res_type=res_type)
161
162 else:
/anaconda2/lib/python2.7/site-packages/librosa/core/audio.pyc in resample(y, orig_sr, target_sr, res_type, fix, scale, **kwargs)
277 return y
278
--> 279 ratio = float(target_sr) / orig_sr
280
281 n_samples = int(np.ceil(y.shape[-1] * ratio))
ZeroDivisionError: float division by zero
Expected Results
Actual Results
Versions
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:14 (4 by maintainers)
Top Results From Across the Web
librosa.load: file not found error on loading a file - Stack Overflow
Two things: It looks like you are using Homebrew; avconv is not in your path. Assuming, you have never installed it, you should...
Read more >Troubleshooting — librosa 0.10.0.dev0 documentation
If you're trying to run some example code, and encounter the following error message: AttributeError: module 'librosa' has no attribute 'display'.
Read more >Librosa not loading mp3 files from dataset. - Reddit
I am working on genre classifying model. An issue I am encountering is librosa is not loading the mp3 file. I am getting...
Read more >Python Audio
When reading audio, librosa.load first tries to use PySoundFile . This works for many formats, such as WAV, FLAC, and OGG. However, MP3...
Read more >Jupyter Audio Basics - Music Information Retrieval
If you receive an error with librosa.load , you may need to install ffmpeg. Display the length of the audio array and sample...
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
@lvbaouu I am stuck with exact same issue with some of my mp3 files. Can you tell me how you fixed it?
yeah, it worked. sorry for the delayed response.
On Mon, Oct 1, 2018 at 8:22 PM Brian McFee notifications@github.com wrote: