bastibe / python-soundfile

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

soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x0000022B81C21850>: Format not recognised. #418

Closed Pannic17 closed 1 year ago

Pannic17 commented 1 year ago

When trying to open a .wav or .mp3 file. i got the error: raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x0000022B81C21850>: Format not recognised. I am using

soundfile.version '0.12.1' soundfile.__libsndfile_version__ '1.2.0' on Windows 10 platform, audio file are playable

bastibe commented 1 year ago

A BytesIO object does not have a file name, so soundfile can't infer the file's format. Without the file name, you need to specify the format manually.

Pannic17 commented 1 year ago

thanks