You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuntimeError: Error opening 'D:/fma_small/000/000002.mp3': File contains data in an unknown format.
During handling of the above exception, another exception occurred:
NoBackendError Traceback (most recent call last)
in
----> 1 y, sr = librosa.load(path, duration=10)
2 ps = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128)
3 ps.shape
c:\python37\lib\site-packages\librosa\core\audio.py in load(path, sr, mono, offset, duration, dtype, res_type)
145 if sys.version_info >= (3, 4):
146 import pathlib
--> 147
148 # check if a Path object is passed by the user
149 if isinstance(path, pathlib.PurePath):
c:\python37\lib\site-packages\librosa\core\audio.py in __audioread_load(path, offset, duration, dtype)
169
170 if sr is not None:
--> 171 y = resample(y, sr_native, sr, res_type=res_type)
172
173 else:
c:\python37\lib\site-packages\audioread_init_.py in audio_open(path, backends)
114
115 # All backends failed!
--> 116 raise NoBackendError()
NoBackendError:
Versions
The text was updated successfully, but these errors were encountered:
the load function is not loading a mp3 file
The code :
import os
import librosa
path = 'D:/fma_small/000/000002.mp3'
path = os.fspath(path)
y, sr = librosa.load(path,
duration=10)
ps = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128)
ps.shape
Expected Results
Just the shape i.e. (128, 431)
Actual Results
RuntimeError Traceback (most recent call last)
c:\python37\lib\site-packages\librosa\core\audio.py in load(path, sr, mono, offset, duration, dtype, res_type)
128 try:
--> 129 with sf.SoundFile(path) as sf_desc:
130 sr_native = sf_desc.samplerate
c:\python37\lib\site-packages\soundfile.py in init(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
628 format, subtype, endian)
--> 629 self._file = self._open(file, mode_int, closefd)
630 if set(mode).issuperset('r+') and self.seekable():
c:\python37\lib\site-packages\soundfile.py in _open(self, file, mode_int, closefd)
1183 _error_check(_snd.sf_error(file_ptr),
-> 1184 "Error opening {0!r}: ".format(self.name))
1185 if mode_int == _snd.SFM_WRITE:
c:\python37\lib\site-packages\soundfile.py in _error_check(err, prefix)
1356 err_str = _snd.sf_error_number(err)
-> 1357 raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
1358
RuntimeError: Error opening 'D:/fma_small/000/000002.mp3': File contains data in an unknown format.
During handling of the above exception, another exception occurred:
NoBackendError Traceback (most recent call last)
in
----> 1 y, sr = librosa.load(path, duration=10)
2 ps = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128)
3 ps.shape
c:\python37\lib\site-packages\librosa\core\audio.py in load(path, sr, mono, offset, duration, dtype, res_type)
145 if sys.version_info >= (3, 4):
146 import pathlib
--> 147
148 # check if a Path object is passed by the user
149 if isinstance(path, pathlib.PurePath):
c:\python37\lib\site-packages\librosa\core\audio.py in __audioread_load(path, offset, duration, dtype)
169
170 if sr is not None:
--> 171 y = resample(y, sr_native, sr, res_type=res_type)
172
173 else:
c:\python37\lib\site-packages\audioread_init_.py in audio_open(path, backends)
114
115 # All backends failed!
--> 116 raise NoBackendError()
NoBackendError:
Versions
The text was updated successfully, but these errors were encountered: