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
MP3 reader support using minimp3 #1851
Conversation
3b004e4
to
ceea31a
Compare
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.
Thanks for the update, @lieff and @eXpl0it3r!
Most looks good now, added a few comments.
Has someone tested this with common MP3 files yet?
Accidently pushed the wrong changes, closing the other PR #1796
This happened to me as well in the past; you should be able to reopen it by pushing to the a with same name (and possibly clicking the "Reopen" button). Just for next time 🙂
That is true if you own the repository you're pushing to. But I accidentally reset lieff's master branch to the official master branch state and by doing so, the PR got closed and also removed the access to push to their repository. |
84b390f
to
188b37b
Compare
188b37b
to
b9dee78
Compare
2f3e353
to
cfe78ea
Compare
e025118
to
a128a3c
Compare
a128a3c
to
025cc94
Compare
fdb2869
to
fd18431
Compare
Even though it's currently not a "symmetric" implementation of decoder/encoder it makes sense to also include it in SFML 2.6 But before merging this, we should spend some time, testing it with various mp3. 🙂 |
For encoder part, https://github.com/cpuimage/tinymp3 can be used, if quality is not the primary concern. |
Anything in particular you'd like to test out? |
Grab some mp3's from your collection (if that's still a thing) and play them with SFML. |
fd18431
to
b7d31e9
Compare
b7d31e9
to
b969127
Compare
Co-authored-by: Lukas Dürrenberger <eXpl0it3r@my-gate.net> Co-authored-by: Vittorio Romeo <vittorio.romeo@outlook.com>
b969127
to
7f77596
Compare
Some testing on Windows 10 x64, using MSYS2/MinGW:
This is what VLC reports for This is what VLC reports for Test files: EDIT: There is definitely a chance to improve our error reporting mechanism here, possibly by using something like EDIT2: With some good-ol' if (hasValidId3Tag(header)) // returns false
return true;
if (hdr_valid(header)) // returns false
return true; @lieff, is this intended? |
Thanks for the clarification. I am quite ignorant regarding music formats, is it uncommon to have an mp3 inside a mp4 container? Would it be hard to support it in minimp3, if it's reasonably common to encounter? |
Not sure how it's common. I've never seen just mp3 audio in mp4 before, aac audio is more native and common to mp4. Minimp3 is not the place where demuxing should be done. https://github.com/lieff/minimp4 can be used for demuxing. Note that mp4 container can contain different audio and video codecs and multiple tracks, so such cases should be handled somehow. For example limit to only audio in mp3 and first track, return error otherwise. Also note that there more popular containers: avi, wmv(wma), mkv, webm, so full proper support for containers is big. Better use ffmpeg or gstreamer in this case. |
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.
From my perspective, I am happy with this PR. I would prefer merging it as it is, get some community testing/feedback, and iterate on any possible issue/improvement that might arise from that.
@eXpl0it3r: happy to merge? |
Thanks a lot @lieff and everyone involved, looking forward to adding MP3 as supported audio format to the changelog 🙂 |
Can we close #1232? |
Since nobody seems to read the issue description, I guess we can close it and open a new issue for implementing a MP3 encoder 😄 See #2679 |
Description
Accidently pushed the wrong changes, closing the other PR #1796
Sorry about that, @lieff
Here's the rebased changes
This PR is related to the issue #1232
How to test this PR?
The sound example was extended and can be executed as a test