// ScopedPointer<AudioFormatReader> audioReader (wavFormat.createReaderFor(new MemoryInputStream (BinaryData::cello_wav,
// BinaryData::cello_wavSize,
// false),true));
FileInputStream* cello = new FileInputStream (File ("./cello.wav"));
if (cello->openedOk()) {
ScopedPointer<AudioFormatReader> audioReader (wavFormat.createReaderFor (cello,true));
BigInteger allNotes;
allNotes.setRange (0, 128, true);
synth.clearSounds();
synth.addSound (new SamplerSound ("demo sound",
*audioReader,
allNotes,
74, // root midi note
0.1, // attack time
0.1, // release time
10.0 // maximum sample length
));
}
Hi I’m trying to also use a file as a synth sound sample and I tried implementing what you talked about, but it doesn’t recognize the file.
I also referred to this link: File streaming FileInputStream/FileOutputStream
Please let me know if you can help!
