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

LAME support for mp3 format?

Open peircej opened this issue 4 years ago • 8 comments
trafficstars

Since mp3 patents have apparently now expired (2017) I guess there isn't a legal issue with using LAME to decode mp3 files anymore? Is it worth looking into here or just waiting for libsndfile to support mp3 natively?

peircej avatar Dec 18 '20 16:12 peircej

I think it would be best to integrate LAME into libsndfile first, and then add the (minor) modifications necessary to support it here.

bastibe avatar Dec 21 '20 16:12 bastibe

Hi @bastibe, FYI: https://github.com/libsndfile/libsndfile/discussions/701#discussioncomment-588058 MP3 is now supported.

oplatek avatar Apr 09 '21 15:04 oplatek

That's fantastic news! And they now provide precompiled binaries for Windows, too!

But as far as I can tell, MP3 support is not yet included in a tagged release, right? I'll update soundfile as soon as MP3 support is officially released.

In the meantime, would (any of) you be interested in contributing a pull request that adds MP3 support to soundfile?

bastibe avatar Apr 11 '21 12:04 bastibe

Hi @bastibe!

In the meantime, would (any of) you be interested in contributing a pull request that adds MP3 support to soundfile?

  1. What is the amount of work we talk about?
  2. Is there an example to be followed?

oplatek avatar Apr 19 '21 04:04 oplatek

Probably not a ton of work. Mostly adding the new _formats, _subtypes, _default_subtypes (copy from the libsndfile header), and making sure everything still works as expected. Then perhaps adding a test, and a note to the README. If all goes well, three new lines in the aforementioned variables is all the code change required to make it work.

Once it is confirmed working and libsndfile tags a new release, I can update the _soundfile_data repo with current binaries and release a new version of soundfile.

bastibe avatar Apr 20 '21 15:04 bastibe

Any updates here? If nobody is working on this, I might take a crack at it.

sammlapp avatar Nov 16 '21 17:11 sammlapp

No update. We are still waiting for libsndfile to ship their MP3 support.

bastibe avatar Nov 17 '21 07:11 bastibe

~Hello @bastibe , @oplatek & @sammlapp ! It looks like libsndfile has released MPEG support in March 2022: https://github.com/libsndfile/libsndfile/releases/tag/1.1.0~

EDIT: Just saw there is already an open PR for this: https://github.com/bastibe/python-soundfile/pull/335 Sorry for the noisy ping 😓

SBrandeis avatar Jul 27 '22 10:07 SBrandeis