On Friday, March 1, 2002, at 10:43 AM, Mathieu Dube wrote:
Im decoding mp3s with a program I wrote using libmad. With most mp3s it works fine but with some it does some tics that it doesnt do if I play the mp3 in xmms. Maybe thats a coincidence but all the mp3s that have tics have a 128kbps bitrate. Did anybody have that type of problems?? Would it be in the reading/decoding or the writing that the problem would be?
A lot of times these kinds of audible problems can be traced to errors in your streaming code. A few tips:
- Don't call mad_stream_buffer() more often than you need to. In particular, don't call it each time you decode a frame. Only call it after you've read more data, usually after mad_frame_decode() returns MAD_ERROR_BUFLEN.
- Remember to copy the remaining data (from stream.next_frame to the end of your original buffer) to the beginning of your new buffer, and append new data after that, before calling mad_stream_buffer().
-- Rob Leslie rob@mars.org