Open bemoody opened 2 months ago
Okay, sorry, got it. I'm now first doing this:
base64 -d -i example.txt -o example.zip
gzip -dc example.zip > example.dat
On MacOS 14.6 Beta (23G5061b) M1 Max, I see the error for soundfile==0.11.0 but not for 0.12.1
pip install soundfile==0.11.0
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/tompollard/projects/wfdb-python/env/lib/python3.9/site-packages/soundfile.py", line 892, in read
frames = self._array_io('read', out, frames)
File "/Users/tompollard/projects/wfdb-python/env/lib/python3.9/site-packages/soundfile.py", line 1341, in _array_io
return self._cdata_io(action, cdata, ctype, frames)
File "/Users/tompollard/projects/wfdb-python/env/lib/python3.9/site-packages/soundfile.py", line 1353, in _cdata_io
self.seek(curr + frames, SEEK_SET) # Update read & write position
File "/Users/tompollard/projects/wfdb-python/env/lib/python3.9/site-packages/soundfile.py", line 799, in seek
_error_check(self._errorcode)
File "/Users/tompollard/projects/wfdb-python/env/lib/python3.9/site-packages/soundfile.py", line 1404, in _error_check
raise LibsndfileError(err, prefix=prefix)
soundfile.LibsndfileError: Internal psf_fseek() failed.
pip install soundfile==0.12.1
Runs without error.
Thanks. That's what I expected. The soundfile builds using libFLAC 1.3.3 apppear to be affected by #486 but not #488; the soundfile builds using libFLAC 1.4.2 appear to be affected by #488 but not #486.
After hammering on this a bit more, it looks like this is actually a bug in libFLAC, and not a bug in libsndfile.
For example, running flac -df -o /dev/null bug486.dat --skip=78420
fails.
However, this bug is not detected by the prober I posted in #488. And as we've seen, this bug exists in libFLAC 1.3.3 but not 1.4.2, whereas the other bug exists in 1.4.2 but not 1.3.3.
1.2.0 broken ... 1.3.3 broken 1.3.4 broken
fixed by 3fc5ba46375e48009cd9428091cd2ffd242de6b9
1.4.0 working 1.4.1 working 1.4.2 working 1.4.3 working
Some versions of the SoundFile package on PyPI, including the latest version (0.12.1), appear to be broken. It appears that something is wrong with the precompiled "libsndfile_x86_64.so". I have no idea about other platforms. I don't know if this is actually a bug in libFLAC, or in libsndfile, or in SoundFile, or a bug in how libFLAC/libsndfile was compiled.
The latest version in the libsndfile-binaries repo is possibly fixed, but there hasn't been a new release of SoundFile for a while.
Here is an example file, gzipped and base64ed:
I think this is a valid FLAC file, though I'm not sure. Running
python3 -c 'import soundfile; soundfile.SoundFile("example.dat").read(78419)'
should succeed.