[mad-dev] simple example using libmad
Thu, 08 Nov 2001 22:22:05 -0800
Wayne Davis wrote:
> I'm trying to create a small footprint program that decodes and plays an
> mp3 from a buffer using libmad.
> I started off with minimad and I recalled that decode_output() handled
> the buffering in madplay. I tried to replicate that by modifying
> minimad.c to include decode_output() and all of its dependencies. This
> required many components from madplay. However, I was never able to get
> this to run correctly.
> I don't think that integrating decode_output() into minimad is the best
> solution. What is the best way to create a simple program to decode and
> play an mp3 from a buffer without using all of madplay (space
What do you mean by "from a buffer"?
decode_output() only handles output, not input -- and it doesn't "buffer"
anything, it just passes the decoded output to an audio output module.
If your MP3 data is entirely in memory, you can use the minimad framework. If
you need to load data from a file, without reading the entire file into memory
at once, you may want to use something like madplay's decode_input_read().