Embed MP3 support by default
Currently, MuseScore requires the LAME library to export MP3. We couldn't include a MP3 encoder because of patents problem. It seems that the patents are now terminated so we could maybe have "native" MP3 export in a future version of MuseScore.
We could integrate LAME directly or wait for libsndfile to add MP3 support.
Some more info:
http://www.audioblog.iis.fraunhofer.com/mp3-software-patents-licenses/
Comments
There is at least one license that is still running, till the end of this year. See https://musescore.org/en/node/2854#comment-688026
Great news. :-)
wait for libsndfile.
Last patent finally expired a couple days ago.
I don't see any traces in libsndfile for mp3 being included anytime soon?
Here's a PR for Windows and the 2.2 branch: https://github.com/musescore/MuseScore/pull/3395
Needs lame_enc.dll (from https://lame.buanzo.org/#lamewindl) to get added to http://utils.musescore.org.s3.amazonaws.com/musescore_dependencies_win3…
For master we may want to use the libsndfile approach. Or this here and switch to libsndfile later. For 2.2 I don't think we should wait for that to happen though
Came up again in https://musescore.org/en/node/46631#comment-821208
Fixed in branch 2.2, commit 51448ec39a
Fix #208006: Add built-in MP3 support for Windows
expects lame_enc.dll (from https://lame.buanzo.org/#lamewindl) to be
found at the same place as libogg.dll, libsndfile-1.dll, libvorbis.dll,
libvorbisfile.dll and portaudio.dll
Fixed in branch 2.2, commit 2d30b1498c
Merge pull request #3395 from Jojo-Schmitz/mp3-windows-2.2
Fix #208006: Add built-in MP3 support for Windows
reopen for 3.0 (see https://github.com/musescore/MuseScore/pull/3501) and Mac
Fixed in branch master, commit bf3e438fb7
Fix #208006: Add built-in MP3 support for Windows
Fixed in branch master, commit f99613fe78
Merge pull request #3501 from lasconic/mp3-windows
Fix #208006: Add built-in MP3 support for Windows
Reopen for Mac
Is it difficult to do the same for macOS?
Looking at https://musescore.org/en/handbook/file-formats#mp3 there seems to be at least 2 different scenarios requiring different libs, so yes, it isn't as trivial as it was for Windows.
It for sure is nothing I can help with, not being a Mac user ;-)
Actually, I'm pretty sure the one from http://thalictrum.com/en/products/lame works for all.
Looking at your Windows one, it seems all you added was the filename—the library itself is not included in the source?
The lib got added to http://utils.musescore.org.s3.amazonaws.com/musescore_dependencies_win3…, so it gets added during build on AppVeyor.
And I have no idea how to do something like for Mac
How about linking directly to the library instead of dlopen()ing it, on Unix and perhaps Mac OSX?
That too requires the lib to be part of the package.
I seems one site for getting libmp3lame.dylib for Mac is gone or broken, http://thalictrum.com/en/products/lame, while the other site's lib (from https://lame.buanzo.org/#lameosxdl) doesn't seem to work on newer (?) Macs?
Can we store this lib (these libs) somewhere on musescore.org, now that all patents have expired, to prevent it/them getting lost?
This problem came up on https://musescore.org/en/node/274044
Is there a known-good way to enable MP3 export on newer Macs by jumping through some hoops? As Jojo points out above, the previous ways do not work.
Maybe https://github.com/defuzeme/desktop/blob/master/client/libraries/ffmpeg… helps? Or one from http://aegiscorp.free.fr/lame/ ?
You can get the file here https://web.archive.org/web/20171230073819/http://thalictrum.com/en/pro…
Came up again in #274114: No MP3-export , unable to open "libmp3lame.dylib"
In reply to You can get the file here… by [DELETED] 5
That worked like a charm.
This is also still missing on GNU.
You mean on certain Linux distributions, don't you?
In reply to You mean on certain Linux… by Jojo-Schmitz
No, I mean,
libmp3lame.so.0
is still pulled in viadlopen
on GNU systems instead of MuseScore linking against (and using) it directly like it was done on Windows recently.MuseScore doesn't link to it on Windows right now. The dll is included and loaded dynamically and MuseScore would still run without it.
MuseScore on Windows and Mac uses a .dll resp. .so. Only change in the Windows version is that we now made lame_enc.dll part of the MuseScore package. The way in which it gets linked in hasn't change at all.
Fixed in branch 2.3.2, commit b5e3f76f2a
fix #208006: Embed MP3 support by default on macOS
Fixed in branch 2.3.2, commit 4592407687
Merge pull request #3839 from lasconic/fix-208006-mac
fix #208006: Embed MP3 support by default on macOS
reopen for 3.0
The approach on mac seems to work ! Just tested on the oldest supported mac, macbook white from mid 2007 running Mac OSX Lion 10.7.5
Fixed in branch master, commit ec80d3b438
fix #208006: Embed MP3 support by default on macOS
Fantastic! :-)
Automatically closed -- issue fixed for 2 weeks with no activity.