I'm looking for sample code for using flac in my program. I want to be able to decode a flac file to PCM. Something like: bool decodeFile( const char* pathNameOfFile, voud** data ); How would I complete the above function? TIA
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.
In Windows, I call FLAC__file_decoder_process_until_end_of_file(); but in MacOS I need to call FLAC__file_decoder_process_whole_file(); Both functions do the same thing yes? Which is going to become the standard?
--- Daniel Tartaglia <daniel_t@earthlink.net> wrote:> I'm looking for sample code for using flac in my program. I want to > be > able to decode a flac file to PCM. Something like: > > bool decodeFile( const char* pathNameOfFile, voud** data ); > > How would I complete the above function?Have you seen the API documentation? The process for the file decoder is described here: http://flac.sourceforge.net/api/group__flac__file__decoder.html#_details There is a C++ wrapper class that makes it even easier. Josh __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com