views:

319

answers:

2

Why would SDL_Mixer not play music for certain mp3s?

I am utilizing SDL_Mixer for music playback in an application I am creating. On certain songs (entire albums actually), the music will simply not play without returning any errors. The music data loads successfully using Mix_LoadMUS and when executing Mix_PlayMusic with that data, it oddly enough returns 0 for success but plays no music. I have also tried reading Mix_GetError() and SDL_GetError() (I believe they're the same) to see if it raises an error, but no such luck.

My question is, what other reasons would SDL_mixer not be able to play a particular mp3?

I know the mp3's are functional since I can play them in other music players. I also know for a fact that they are not playing (as opposed to perhaps the volume being turned down) since Mix_PlayingMusic returns 0.

Thanks everyone!

A: 

Different implementations of the MP3 algorithm tolerate different levels of conformance to the format. Most of the music players are pretty tolerant, because most users would rather hear something choppy than nothing at all, but the playback libraries that are common tolerate much less.

I'd recommend opening the offending (Or all) mp3's in an audio sample editor, such as Audacity, and reexporting the mp3. You might lose just a little bit of quality since the mp3 compression is by it's nature lossy, but it's likely to fix the playback problem.

TokenMacGuy
The primary problem I have with this is that the application is made to play other users media so while that might work to get my system up and running, I can't go around converting other users MP3's unless I have a programmatic way of doing so.
Bit Destroyer
A: 

This actually wound up being a sound issue with that particular computer. Upon trying the same tests on another machine, the sound worked flawlessly. Just a quick note in case someone else encounters this issue.

Bit Destroyer