-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Certain MP3 files don't keep looping when using sf::Music
#2215
Comments
SFML supports the audio file formats WAV, OGG/Vorbis and FLAC. Due to licensing issues MP3 is not supported. |
No, MP3 is supported by SFML 2.6.X. The last patents have expired in 2017. |
You're right, didnt know it was added to SFML 2.6.x. Reproduced your issue and checked whether AL was processing the stream buffers correctly and it is indicating that there are none being processed after the first loop. So loop looks to be working fine, but likely the seek to Time::Zero once the mp3 is finished is not working. Not knowledgeable enough to edit minimp3, but I did try to verify your solution and did not see it working for me. |
Looks like @lieff is currently not responding, as such, I don't see us fixing this for the up coming SFML 2.6 release and I'll move it to SFML 2.6.1 in hopes they come back at one point. |
Hey @eXpl0it3r, at this point it is kind of safe to assume that minimp3 is abandoned, is it maybe possible that the SFML team creates a fork of it and maintains that separate fork for future bug fixes? I am not sure what the best-practice is in such a case, but it is a bit of a shame that this cannot be fixed due to an abandoned repo. |
I don't think we have the capacity to maintain such a fork. Maybe there have been other people forking already, are you aware of anything? Otherwise we'll probably need to look for alternatives. In that case (different MP3 backend), it's more likely that this lands in SFML 3 though. |
I've tested the provided files with the dr_mp3 implementation and they loop without issues. dr_mp3 uses most of the minimp3 implementation with some API improvements and is written and maintained by the same person that wrote miniaudio and they're still quite active. It's been a while but if anyone here wants to test the #2995 PR, @Biohazard90 / @TiEul |
@eXpl0it3r Thanks, we don't have the resources to verify it right now but we'll add it to our to-do list and we'll provide feedback here. |
sf::Music
Certain MP3 files not looping
Certain mp3 files are not looping correctly when playing them with sf::Music and looping enabled. One of them doesn't loop at all (issue 1), the other stops looping after the first time (issue 2).
Your environment
Steps to reproduce
Expected behavior
The music should never stop playing.
Actual behavior
The file "SIERRA - UNBROKEN (mp3cut.net).mp3" stops playing after the first playthrough (issue 1), the file "Feeling - Tung Wasabi (mp3cut.net).mp3" stops playing after the second playthrough (issue 2).
Analysis
In both cases the problem is that SFML only loops a file if the expected EOF point is reached and minimp3 doesn't reach it, instead it fails reading more data.
Regarding issue 1, I believe the file may report the incorrect number of samples and minimp3 takes it at face value, then just stops streaming too early when EOF is reached. Since I currently needed a solution to this, I made a workaround for myself so SFML continues looping when EOF is reached too early: Biohazard90@bcd6798 Note, this is not a fix I am proposing, it's just to illustrate the issue and how I'm solving it since I cannot fix the mp3 files I'm working with.
Regarding issue 2, minimp3 seems to be incorrectly seeking to 0 and I proposed a fix here already: lieff/minimp3#101
Here are the two mp3 files that have these issues:
Example mp3 files
The text was updated successfully, but these errors were encountered: