On Saturday, May 25, 2002, at 02:42 AM, Reza Naima wrote:
I'm trying to write some mp3 playing software (www.reza.net/rio/rrr.html) for the rio receiver using the mad libraries. I've followed the example from minimad, and I've been able to make some progress, but there are some issues I'm having.
[...]
- output callback is called multiple times
- I get some audio out, music + loud clicks, till it runs out of data to decode
- input callback is called
- error callback called (MAD_ERROR_LOSTSYNC)
- error callback called
- the error code varies here, so far I've seen either MAD_ERROR_BADSAMPLERATE or MAD_ERROR_BADDATAPTR
- i stop decoding at this point.
now, as I'm also getting the MAD_ERROR_LOSTSYNC with minimad, I'm guessing (hoping) that I'm feeding some incorrect compile option to the madlibs. Any thoughts would be greatly appreciated.
Does minimad run correctly, and can you play the resulting audio without loud clicks? If so, it would seem MAD is working.
You might be having difficulty with MAD's stream API. You might want to have a look at Bertrand Petit's madlld for further guidance. His demo uses the low-level API rather than the high-level one, but you can extrapolate from it what you should be doing in the input callback.
http://www.bsd-dk.dk/%7Eelrond/audio/madlld/
-- Rob Leslie rob@mars.org