[Flac-users] Embedding the decoder... Sample code?

Josh Coalson xflac at yahoo.com
Sat Jan 18 22:26:03 PST 2003


--- Daniel Tartaglia <daniel_t at earthlink.net> wrote:
> 
> So, I wrote the code to decompress a flac file using the C interface.
> 
> Everything seems to work alright, except the sound doesn't play 
> right... I have some questions about the write callback function...
> 
> Assuming a 16 bit mono sound, how should I copy the buffer out into
> my 
> own buffer? Right now I'm simply copying the FLAC__int32* into my own
> 
> FLAC__int32*...
> 
> Could this be an endian issue, or does FLAC take care of those.

decoded data is always signed and in host order.  the 'buffer' you
get back is actually an array of pointers to arrays, one for each
channel, so for a mono signal, buffer[0] will be a pointer to the
decoded audio data.

Josh


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com




More information about the Flac mailing list