Love, Linux and MP3s

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Xcmd
Party member
Posts: 211
Joined: Fri Feb 13, 2009 10:45 pm

Love, Linux and MP3s

Post by Xcmd »

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?

Here's my code:

Code: Select all

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!
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Love, Linux and MP3s

Post by bartbes »

maybe the file was called .MP3? (uppercase) Because it sounds mostly like an uppercase-lowercase problem.
User avatar
Xcmd
Party member
Posts: 211
Joined: Fri Feb 13, 2009 10:45 pm

Re: Love, Linux and MP3s

Post by Xcmd »

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!
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Love, Linux and MP3s

Post by rude »

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).
User avatar
Xcmd
Party member
Posts: 211
Joined: Fri Feb 13, 2009 10:45 pm

Re: Love, Linux and MP3s

Post by Xcmd »

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!
User avatar
farvardin
Party member
Posts: 167
Joined: Sat Jun 28, 2008 6:46 pm

Re: Love, Linux and MP3s

Post by farvardin »

why don't you just use ogg instead of mp3 ?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Love, Linux and MP3s

Post by Robin »

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].
.
Help us help you: attach a .love.
User avatar
Xcmd
Party member
Posts: 211
Joined: Fri Feb 13, 2009 10:45 pm

Re: Love, Linux and MP3s

Post by Xcmd »

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!
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 0 guests