Hello
I run the following code. It works on the simulated device. On the real one, it can’t seem to be able to create the fileOutputStream (null).
AudioSampleBuffer buffer;
buffer.setSize(1, 88200);
for (int i = 0; i < buffer.getNumSamples(); i++)
{
buffer.setSample(0, i, .5f);
if (i < 44100)
buffer.setSample(0, i, -.5f);
}
const File file (File::getSpecialLocation(File::currentApplicationFile).getFullPathName() + "/AudioFiles/NEW.wav");
DBG("FiLe FULLPATHNAME : " << file.getFullPathName());
file.deleteFile();
ScopedPointer<FileOutputStream> fos (file.createOutputStream());
WavAudioFormat wavFormat;
AudioFormatWriter* afw =
wavFormat.createWriterFor(fos, 44100, buffer.getNumChannels(), 16, StringPairArray(), 0);
afw->writeFromAudioSampleBuffer(buffer, 0, buffer.getNumSamples());
(all this on Xcode 8.3.3, MacMini 2012, OS 10.12.5, targetting iOS 10.3)