Sorry to (probably) ask a stupid question, but I was trying to use a file as a sample to replace the binary stream stored (by what software btw ?) in BinaryData.cpp as a copy of a cello.wav file in the JuceDemo project.
I thus replaced the original:
ScopedPointer<AudioFormatReader> audioReader (wavFormat.createReaderFor (new MemoryInputStream (BinaryData::cello_wav, BinaryData::cello_wavSize, false),true));
with something like (don't worry this is not a final code, just testing...):
FILE *wavsmpl1; void *buffer; size_t fileSize; wavsmpl1 = fopen("cello.wav","r"); // cello.wav is in JuceDemo.app folder for testing purpose fileSize = ftell(wavsmpl1); buffer = malloc(fileSize); fread(buffer,1,fileSize,wavsmpl1); ScopedPointer<AudioFormatReader> audioReader (wavFormat.createReaderFor (new MemoryInputStream (buffer,fileSize,true),true));
but I get 0 in audioReader.
Any hint ? This is done on a Mac for the MacOS platform but I am assuming that does not make a difference.