Seems there's a problem with the high-level API..
First off, the mmap() function in madplay was failing for some reason. So I added an open() and used that filedescriptor rather than the stdio's fd. Running it generated this error, which is what I also see when I try to use the high-level API with my code :
minimad > /tmp/r decoding error 0x0101 (lost synchronization) at byte offset 0
I modified minimad again, this time to ignore that error. The output is identical to what I heard when I was doing the decoding with my application.
However, I also tried using madplay (raw output format), and it worked great. Audio sounded perfect. So, what do you think the problem could be with the high level API?
Thanks, Reza
Rob Leslie wrote:
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