bastibe / python-soundfile

SoundFile is an audio library based on libsndfile, CFFI, and NumPy
BSD 3-Clause "New" or "Revised" License
676 stars 105 forks source link

soundfile.LibsndfileError: Error : unknown error in flac decoder #388

Closed philgzl closed 1 year ago

philgzl commented 1 year ago

I am getting the following error on some of my FLAC files with soundfile==0.12.1:

Traceback (most recent call last):
  File "/zhome/d6/0/134239/dummy_project/temp3.py", line 3, in <module>
    sf.read('audio/00003_mixture.flac')
  File "/zhome/d6/0/134239/dummy_project/venv/lib/python3.10/site-packages/soundfile.py", line 288, in read
    data = f.read(frames, dtype, always_2d, fill_value, out)
  File "/zhome/d6/0/134239/dummy_project/venv/lib/python3.10/site-packages/soundfile.py", line 895, in read
    frames = self._array_io('read', out, frames)
  File "/zhome/d6/0/134239/dummy_project/venv/lib/python3.10/site-packages/soundfile.py", line 1344, in _array_io
    return self._cdata_io(action, cdata, ctype, frames)
  File "/zhome/d6/0/134239/dummy_project/venv/lib/python3.10/site-packages/soundfile.py", line 1354, in _cdata_io
    _error_check(self._errorcode)
  File "/zhome/d6/0/134239/dummy_project/venv/lib/python3.10/site-packages/soundfile.py", line 1407, in _error_check
    raise LibsndfileError(err, prefix=prefix)
soundfile.LibsndfileError: Error : unknown error in flac decoder.

Note the error is not raised with soundfile==0.12.0 or soundfile==0.11.0.

Example file: 00003_mixture.tar.gz

philgzl commented 1 year ago

Nevermind, this is a libsndfile error and didn't realise the loaded libsndfile version on my system was changing when changing soundfile versions.