[mad-dev] question about decode mp3-encoded wav

Rob Leslie rob@mars.org
Mon, 21 Jun 2004 17:42:20 -0700

On Jun 20, 2004, at 11:22 AM, shiming dong wrote:
> I tried to get the raw pcm data from a mp3-encoded riff wav file. Can 
> I use the libmad to do that? I mean, except to the header of the file, 
> is each frame header and data the same as that in the mp3 file? And 
> where can I get such file's format description?

As far as I know, an MP3-encoded WAV file is just an MP3 stream wrapped 
with a Microsoft RIFF header. You ought to be able to decode the MP3 
stream with libmad whether or not you actually unwrap the RIFF header; 
libmad will seek until it finds a valid sync word marking the stream.

I don't have pointers handy for the RIFF/WAVE file format but they 
shouldn't be hard to locate online.