On Thu, 2002-03-21 at 20:53, iroro wrote:
so the more general question is what is the best way for CBR and VBR layer 3 encodings to decode just the first 30 seconds to pcm? especially without having to scan through the whole file ...
MAD makes it easy. Use the mad_timer functionality and the duration field of the mad_frame structure; every time you receive a frame in your header callback, add duration to your running total. (mad_timer_add) Once that equals or exceeds 30 seconds, return MAD_FLOW_STOP from the header function, and you'll immediately stop the decoding process.