So today I actually had cause to use an mp3 in my project, but when I ran it, Love gave me an error saying it couldn't load the file. I thought it was a tad odd, so I converted the MP3 into OGG Vorbis format, changed the code to read the .ogg file instead and ran that. Worked a charm. I'm guessing there's some sort of dependency Love is expecting for MP3s that I don't have? Or am I just doing it wrong, somehow?
if musicFile ~= "nil" then
gameMusic = love.audio.newMusic( musicFile ) -- Create the music
if gameMusic ~= nil then -- make sure it loaded
love.audio.play( gameMusic, 0 ) -- Play the music forever
else
errorMessage("Unable to load music... continuing...")
end
end
The specific error message is: Could not load music "sooh.mp3".
musicFile is defined elsewhere by the program. Any ideas?
We don't borrow, we don't read, we don't rent, we don't lease, we take the minds!
bartbes wrote:maybe the file was called .MP3? (uppercase) Because it sounds mostly like an uppercase-lowercase problem.
Nope. I double-checked and the case is correct. Both are .mp3... I don't mind, terribly.I consider Ogg a superior format. But I'm planning on my game being modular and it'd be nice to know if there are issues with the MP3 library on Ubuntu.
We don't borrow, we don't read, we don't rent, we don't lease, we take the minds!
Bug in SDL_mixer. It works on Windows only because I patched the DLL.
The bug applies to mp3 files with the "new" magic byte sequence. SDL_mixer does not check for this byte sequence, and tries to load the file with MikMod (which is the default).
Ah. Thanks. That's a thing that's good to know. I'll make sure to include that in the documentation and let people know it's an SDL issue, not an issue with the game.
We don't borrow, we don't read, we don't rent, we don't lease, we take the minds!
farvardin wrote:why don't you just use ogg instead of mp3 ?
That's what he did in the end, wasn't it?
Xcmd wrote:I thought it was a tad odd, so I converted the MP3 into OGG Vorbis format, changed the code to read the .ogg file instead and ran that. Worked a charm [sic].
That is indeed what I wound up doing. But for a project I have in mind, its necessary to know that Linux doesn't support MP3s due to difficulties beyond my control.
And the phrase "Worked a charm." is indeed correct, just not grammatically perfect, as few of my sentences are. I write like I speak, for the most part.
We don't borrow, we don't read, we don't rent, we don't lease, we take the minds!