bastibe / python-soundfile

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

"Format not recognised." for m4a files #431

Open bohning opened 7 months ago

bohning commented 7 months ago

When I try to read an m4a file via

import soundfile as sf
data, samplerate = sf.read('test.m4a')

I get the following error:

soundfile.LibsndfileError: Error opening 'songs/test.m4a': Format not recognised.

Is m4a not supported? Or am I doing something wrong? The file plays just fine e.g. in VLC, was encoded by "Lavf60.3.100".

bastibe commented 7 months ago

M4A is not supported. Soundfile is based on libsndfile, and libsndfile does not support M4A, as it is encumbered by patents. The last M4A patents will expire in 2028 (base profile) and 2031, so expect support to be added some time after that.

bohning commented 7 months ago

Ah, good to know. Thanks a lot for your answer.