librosa: OSError: file not found
Description
Description
I face a problem when I follow the tutorial:
# Beat tracking example
from __future__ import print_function
import librosa
# 1. Get the file path to the included audio example
filename = librosa.util.example_audio_file()
# 2. Load the audio as a waveform `y`
# Store the sampling rate as `sr`
y, sr = librosa.load(filename)
# 3. Run the default beat tracker
tempo, beat_frames = librosa.beat.beat_track(y=y, sr=sr)
print('Estimated tempo: {:.2f} beats per minute'.format(tempo))
# 4. Convert the frame indices of beat events into timestamps
beat_times = librosa.frames_to_time(beat_frames, sr=sr)
print('Saving output to beat_times.csv')
librosa.output.times_csv('beat_times.csv', beat_times)
Steps/Code to Reproduce
Expected Results
It may run without error
Actual Results
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/zhongyi/anaconda3/envs/tf-torch/lib/python3.6/site-packages/librosa/core/audio.py", line 119, in load
with audioread.audio_open(os.path.realpath(path)) as input_file:
File "/home/zhongyi/anaconda3/envs/tf-torch/lib/python3.6/site-packages/audioread/__init__.py", line 111, in audio_open
return ffdec.FFmpegAudioFile(path)
File "/home/zhongyi/anaconda3/envs/tf-torch/lib/python3.6/site-packages/audioread/ffdec.py", line 150, in __init__
self._get_info()
File "/home/zhongyi/anaconda3/envs/tf-torch/lib/python3.6/site-packages/audioread/ffdec.py", line 206, in _get_info
raise IOError('file not found')
OSError: file not found
Versions
>>> import platform; print(platform.platform())
Linux-4.15.0-51-generic-x86_64-with-debian-buster-sid
>>> import sys; print("Python", sys.version)
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
>>> import numpy; print("NumPy", numpy.__version__)
NumPy 1.13.3
>>> import scipy; print("SciPy", scipy.__version__)
SciPy 1.1.0
>>> import librosa; print("librosa", librosa.__version__)
librosa 0.6.3
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 27 (13 by maintainers)
Are you sure that the file exists?