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 opening <tempfile._TemporaryFileWrapper object at 0x7feadae59070>: Format not recognised. #432

Closed qdDog closed 2 months ago

qdDog commented 2 months ago

QQ图片11111

QQ图片20240422181519

__version__ 0.12.1
libsndfile_version__ 1.2.0

i got this error, what's wrong? can anyone help me?

bastibe commented 2 months ago

A tempfile does not have a file name, and no file extension. Soundfile uses the file extension to figure out the audio format. For a tempfile, you need to provide a format explicitly to soundfile.read and soundfile.write.

qdDog commented 2 months ago

A tempfile does not have a file name, and no file extension. Soundfile uses the file extension to figure out the audio format. For a tempfile, you need to provide a format explicitly to soundfile.read and soundfile.write.

Solved it, my package was installed incorrectly