--- Lars von Wedel <[EMAIL PROTECTED]> wrote: > However there are two issues I'm unsure about: > > - Do I need to convert the decoded audio data delivered to the > FileDecoderWriteCallback to be compatible with mad_pcm/mad_fixed_t > data?
not sure about the mad_fixed_t format, but probably. all samples coming out of the FLAC decoder are linear PCM 32-bit signed ints. e.g. a sample from CD audio will be in the range -32768 (0xFFFF8000) to 32767 (0x00007FFF) > - The mad_pcm structure expects 1152 samples per channel. > How Do I obtain 1152 samples from the Flac decoder? since the write callback will be called once for each frame, and the number of samples in a FLAC frame can vary, your write callback will probably have to write to an intermediate buffer. the same thing has to happen in the winamp2 plugin, so you can look at that code for an example (search for reservoir_ and SAMPLES_PER_WRITE). http://cvs.sourceforge.net/viewcvs.py/flac/flac/src/plugin_winamp2/in_flac.c?view=markup Josh __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ Flac-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/flac-users