I'm investigating aurioTouch2 sample code.
I wanna change smth to record audio from microphone and to write these data to .caff or .wav file. So later I will be able to play this audio with AVAudioPlayer.
My idea is to use AVAudioRecorder in applicationDidFinishLaunching, but may be it's not the best solution or may be even it's not possible by this way (I've not tried to use AVAudioRecorder, because I think that most likely it's not the best idea). I've tried to write byte data in
void FFTBufferManager::GrabAudioData(AudioBufferList *inBL)
{
memcpy(mAudioBuffer+mAudioBufferCurrentIndex, inBL->mBuffers[0].mData, bytesToCopy);
// after this I copy to my own buffer and collect all the data during 30 seconds
}
So as you see, I copy to my own buffer and collect all the data during 30 seconds. Than I write data to .caff file. That doesn't work.
Update:
Or may be the way of playing binary data of audio (not encoded to .waf or .caff audio) exist?