I need MAD to decode in chunks, with an arbitrary amount of time between the decoding of each chunk (e.g. I decode the first 50000 samples and then a second later I decode the next 50000 samples), and I'm running into the problem of MAD losing syncronization as I begin to decode each chunk, resulting in the loss of several frames each time. Can anybody help me?
On Tuesday, December 3, 2002, at 10:50 AM, dellario@attbi.com wrote:
I need MAD to decode in chunks, with an arbitrary amount of time between the decoding of each chunk (e.g. I decode the first 50000 samples and then a second later I decode the next 50000 samples), and I'm running into the problem of MAD losing syncronization as I begin to decode each chunk, resulting in the loss of several frames each time. Can anybody help me?
You might be losing data between chunks passed to libmad, because MAD does not consume the entire chunk. You have to arrange for the unconsumed data (from stream.next_frame to the end of your buffer) to appear in contiguous fashion at the beginning of the next chunk.