-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MP3 import #6750
Add MP3 import #6750
Conversation
We'll want to make sure that libsndfile is >=1.1.0 for this like @PhysSong mentioned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding support for MP3 was really just a handful of lines. Sorry if I threw you off by saying there might be a merge conflict 😅 (since I moved SampleBuffer::openAudioFile
into its own class, there might be, but it would be be extremely simple to resolve).
Alright, as @sakertooth pointed out, apparently LMMS already had MP3 import capabilities this whole time. It just... wasn't enabled. I guess. Kind of at a loss for words, I'll admit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too easy 😂
I still think the CMake changes are necessary though, because we still need to ensure the version for sndfile is |
We only got MP3 import because it was added to sndfile in v1.1.0, and we were already using sndfile to begin with to decode audio files from disk, so increasing our sndfile version to v1.1.0 was the majority of the work for adding MP3. |
Do we need |
Yes, we should add some. 1.1.0 was released in 2022 so not every distro will have it. |
@Veratil I meant to ask where the |
Well that should be fixed actually. |
I would think OGG support is available for the majority, if not all users, no? |
Alright, I added all the needed checks for MP3 support. |
Probably, if using libsndfile for it then it's been there since 2009. But if for some reason we have a build without support we shouldn't advertise the extension. |
I think both mingw and msvc in the CI are build with libsndfile 1.0.28 so it can't be tested. |
It's just mingw. MSVC uses the latest versions available on vcpkg (it's 1.2.0 for vckpg) |
Try force setting it to true to see if it you can still decode MP3s successfully, or if you end up crashing or it fails to load. That'll tell us its at least |
I think 1.0.28 is still the current version for mingw builds, per https://launchpad.net/~tobydox/+archive/ubuntu/mingw-w64. We can ping @tobydox to see if there's a newer version available. |
I don't know how to force setting the variable in the CI. I've tried to build it locally but it doesn't work, but I not sure if the problem is with my local environment and not sndfile. Maybe someone can push a commit without checking the version. Or maybe the problem is related to what PhysSong said about it before. |
Perhaps: IF(SNDFILE_FOUND)
+ SET(SNDFILE_VERSION "1.2.0") # TODO: REMOVE THIS LINE!
IF(SNDFILE_VERSION VERSION_GREATER_EQUAL 1.1.0)
SET(LMMS_SNDFILE_MP3 TRUE)
ELSE()
MESSAGE("libsndfile version is < 1.1.0; MP3 import disabled")
SET(LMMS_SNDFILE_MP3 FALSE)
ENDIF()
ELSE() |
Sorry, this looks merged but I still can't find a way to import audio in mp3 format, at least in the appimage, has this been forgotten? |
Linux appimage doesn't support mp3 import due to outdated libs used by the CI. If you build it yourself, you can use mp3, unless you are on ubuntu/derivatives |
But these obsolete libraries will not be updated? Do you think this prevents other improvements from being implemented in the future? I know I can build it myself, but believe me, the average user doesn't even know the most basic of those code things. |
@Gabrielxd195 Linux AppImages will have mp3 and opus support once #7316 is merged. |
Thank you very much, users will be happy with this improvement. |
Trying MP3 out with #7526 (comment). Works great on Windows when compiled with MSYS2 UCRT64 and MINGW64. |
Allows AudioFileProcessor and Sample Tracks to load MP3 files. Finally.
Fixes #2000