fix: SoLoudFileLoadFailedException:... (on the C++ side) with some specific files
When loading some specific mp3 files the engine throws SoLoudFileLoadFailedException: File found, but could not be loaded! Could be a permission error or the file is corrupted. (on the C++ side).
Example file: https://drive.google.com/file/d/1jLEHW0h-5My1hVUqGcQXYwG-I46vQKM7/view?usp=sharing (Can't attach to the report as mp3 isn't allowed)
Steps to reproduce
- Load file with loadAsset() or loadFile()
- An exception is being thrown
Expected Behavior
The file should get loaded as it's a valid mp3
Hi @mokus,
I tried your audio and I got the same result. It can be played by Vlc, but the C lib used in flutter_soloud cannot decode it!
I am afraid that we should wait for a fix in dr_mp3.h.
Meanwhile, you can use ffmpeg to rewrite the mp3 like this:
ffmpeg -i i_lost_at_the_game_again.mp3 -b:a 128k i_lost_at_the_game_again-B.mp3
I tried the new audio and it works.
@alnitak Thank you for such a quick reply. Would converting to ogg be a better option?
Would converting to ogg be a better option?
ogg is usually better than mp3, for size and quality at the same bitrate. But you need to try for your use case. I bet on ogg format :)
update: here an interesting reading https://www.gumlet.com/learn/ogg-vs-mp3/
I've been running into this with some .wav files. I'll report what I learn here.
It turned out that MacOS was lying about some files being .wav when they were actually aiff, so just converted those to be real .wav files.