ValueError:使用Librosa在mp3中阅读时嵌入了空字符

时间:2019-09-14 01:26:51

标签: python mp3 librosa

我正在尝试使用librosa.load在具有Python 3.6的Jupyter Notebook中读取mp3文件。

我不太确定该怎么做,我对这个特殊问题还不太满意。以下是我正在使用的代码以及我不断收到的错误消息。

raw_data_path = 'D:filepath_to_folder'
mp3_track_1 = raw_data_path + '\000\000005.mp3'
y, sr = librosa.core.load(mp3_track_1)

ValueError                                Traceback (most recent call last)
<ipython-input-24-80081ad2f4b3> in <module>
      2 raw_data_path = r'D:\genre_classification_project\Raw Data\fma_small'
      3 mp3_track_1 = raw_data_path + '\000\000005.mp3'
----> 4 y, sr = librosa.core.load(mp3_track_1)

~\Anaconda3\envs\genre_classification_env\lib\site-packages\librosa\core\audio.py in load(path, sr, mono, offset, duration, dtype, res_type)
    110 
    111     y = []
--> 112     with audioread.audio_open(os.path.realpath(path)) as input_file:
    113         sr_native = input_file.samplerate
    114         n_channels = input_file.channels

~\Anaconda3\envs\genre_classification_env\lib\site-packages\audioread\__init__.py in audio_open(path)
     78     from . import rawread
     79     try:
---> 80         return rawread.RawAudioFile(path)
     81     except DecodeError:
     82         pass

~\Anaconda3\envs\genre_classification_env\lib\site-packages\audioread\rawread.py in __init__(self, filename)
     59     """
     60     def __init__(self, filename):
---> 61         self._fh = open(filename, 'rb')
     62 
     63         try:

ValueError: embedded null character

0 个答案:

没有答案