python-soundfile icon indicating copy to clipboard operation
python-soundfile copied to clipboard

Cannot read mp3 with file-like object

Open BakerBunker opened this issue 7 months ago • 7 comments

I tried to read a mp3 with file handle, but soundfile failed to read.

import soundfile as sf

ret = sf.read("052316.mp3")
print(ret)

try:
    sf.read(open("052316.mp3", "rb"))
except Exception as e:
    print(e)

it shows

(array([[0., 0.],
       [0., 0.],
       [0., 0.],
       ...,
       [0., 0.],
       [0., 0.],
       [0., 0.]]), 44100)
Error opening <_io.BufferedReader name='052316.mp3'>: Format not recognised.

and here is the file 052316.mp3.zip

BakerBunker avatar Jul 12 '24 08:07 BakerBunker