Reading and Writing FLAC data into XML files

Guys, I haven´t read the whole documentation on how to handle FLAC files yet, so, please, bear with me. I´m asking it here so I don´t spend days trying to understand something just to find out, in the end, that it won´t work... ;-)

So, my idea is simple. To read WAV/AIFF files and store the data into memory, so my Sample-Playback code can handle it. This is for my new Wusik 4000 project.

Now, when saving a preset, I want to get this sample-information, compress to some format, let us say, FLAC, and store in the preset XML file.

Any hints on this, please?

Thanks in advance.

Best Regards, WilliamK

Ok, reading the WAV/AIFF files is easy, from what I could see, unless I´m doing it wrong. ;-)

AudioFormatManager formatManager;
AudioFormatReader* reader = formatManager.createReaderFor (audioFile);
if (reader != nullptr)
    /*void AudioFormatReader::read (AudioSampleBuffer* buffer,
                              int startSample,
                              int numSamples,
                              int64 readerStartSample,
                              bool useReaderLeftChan,
                              bool useReaderRightChan)*/

Now I just need to figure a way to transform an AudioSampleBuffer variable into a FLAC compressed thing I could store in a XML file.

Ok, looks like I can use MemoryOutputStream and MemoryInputStream, and just get the MemoryBlock  getMemoryBlock() and that I can use for the XML file. NEAT!

Jules, great work. :-)