[sdlsound] pcm data from sample.buffer

Ryan C. Gordon icculus at icculus.org
Wed Oct 26 11:55:10 EDT 2011

> I'm trying to get the raw PCM data, from a decoded mp3 file.
> I'm only interested in the raw pcm data, and not to output it to eg. sdl-audio.But if try to look into the sample.buffer after decoding, the buffer seems empty. (See below).
> But if i modify eg. playsound_simple.c, in the audio callback function there are data in the buffer.
> It looks like SDL_OpenAudio does something to the data?
> Is it possible to somehow get the raw pcm data without using eg. SDL_OpenAudio?

You're probably using smpeg to decode the data, and it won't work 
without an open SDL audio device (which is silly, but that's how smpeg 

Use mpglib instead.


More information about the sdlsound mailing list