[sdlsound] playsound error:MPGLIB: Free format not supported.
Ryan C. Gordon
icculus at icculus.org
Wed Jan 24 16:59:34 EST 2007
> Here is the output. Note: I always see the
> "audio_alsa: no cards found!" when playing ogg files
> too, but the audio works.
SDL is probably trying ALSA first, then falling back to the OSS driver
API or arts or something, so it found _something_ that worked, just not
ALSA.
It really shouldn't write anything to stderr/stdout, since that's
impolite, but it might be alsalib doing that and not SDL or SDL_sound.
> [kevin at pan SDL_sound-stable-1.0]$ sudo playsound
> 01_-_Stay_Where_You_Are.mp3
> audio_alsa: no cards found!
> Now playing [01_-_Stay_Where_You_Are.mp3]...
> Error in decoding sound file!
> reason: [MPGLIB: Free format not supported.].
mpglib is deeply unforgiving about file corruption...it gives up
immediately when it sees data it doesn't expect, which is a problem with
a lot of mp3s out there.
Also, unfortunately, one of the things it doesn't expect is ID3v2 tags,
so that excludes the vast majority of mp3s created in the past few
years. This is fairly easy to fix, just no one ever has (for ID3v1, we
just look for the struct in the last 128 bytes of the mp3, and don't
pass it to mpglib if we see it. ID3v2's layout is somewhat more
complicated, but something similar can still be done). In a more ideal
world, someone would take the time to understand the mpglib code and
make it recover from bad data. Or replace it with a different mp3
decoder, but I haven't found one that isn't GPL'd.
SDL_sound's SMPEG backend is more forgiving of strange data, but has its
own problems too. Use Ogg files if you control your content. :)
As you can tell by my long apology here, we're sort of at the mercy of a
disproportionate amount of third-party code here.
--ryan.
More information about the sdlsound
mailing list