[SDL] SDL_mixer is recognizing MP3 as MOD

Mason Wheeler masonwheeler at yahoo.com
Thu Jul 14 17:19:29 PDT 2011

Well, that's what's happening.  You've basically got three options.

1) Use something else instead of SDL_Mixer
2) Hack SDL_Mixer and make the verification work
3) Monitor your music and dynamically fix the broken songs in memory before they get sent to SDL_Mixer

From: Nikos Chantziaras <realnc at arcor.de>
To: sdl at libsdl.org
Sent: Thursday, July 14, 2011 4:17 PM
Subject: Re: [SDL] SDL_mixer is recognizing MP3 as MOD

Extracting the file and playing it with madplay and mpg123 works.  The file *seems* damaged though.  madplay says:

  error: frame 0: lost synchronization
  error: frame 4: lost synchronization

but plays the file fine.  The original Windows-only engine (which my Linux/Mac application must be compatible with) is very tolerant on this and plays MP3s even if they seem damaged (using code from mpg123), and therefore there are games for that engine that seem to use damaged MP3s.  Obviously, I need to be able to do the same, otherwise I'm not going to be compatible with the original Windows-engine.

On 07/15/2011 01:45 AM, Mason Wheeler wrote:
> Verify the file in a different media player. SDL_Mixer attempts to check
> "magic numbers" in a music file's header against known values, and if it
> can't find a match, it defaults to MOD. What this behavior means is that
> the check against the known header magic number for an MP3 file is
> failing, which most likely means your file is corrupt in some way.
> *From:* Nikos Chantziaras <realnc at arcor.de>
> *To:* sdl at libsdl.org
> *Sent:* Thursday, July 14, 2011 3:34 PM
> *Subject:* [SDL] SDL_mixer is recognizing MP3 as MOD
> There's one MP3 track that when trying to load it with Mix_LoadMUS_RW(),
> SDL_mixer thinks it's a MOD file and fails with "Module format not
> recognized". Is there anything I can do about it? When loading it, I
> know it's going to be MP3 data, but I can't find any way to tell that to
> SDL_mixer.
> Touching the MP3 data itself is not an option, since the application is
> a game engine (a bit like SCUMMVM) that runs pre-existing games made by
> people I never heard about.
> I'm out of ideas :-/
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SDL mailing list
SDL at lists.libsdl.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110714/c880bb6b/attachment-0008.htm>

More information about the SDL mailing list