I'm newbie in iPhone programming and i need some help. I'm writing an application which should record audio and video data simultaneously but to different targets because i need to process audio data separately.
So i tried several ways of implementing this and decided to do it with AVFoundation.
The problem is i really don't know how to save output audio data to a file by my own.. What format and other properties should i use for it..
I set up audio input for AVCaptureSession and receive audio data in the following way:
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection
{
AudioBufferList audioBufferList;
CMBlockBufferRef blockBuffer;
// Here i get AudioBufferList to save audio data
CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(
sampleBuffer,
NULL,
&audioBufferList,
sizeof(audioBufferList),
NULL,
NULL,
0,
&blockBuffer);
// Here should be saving logic
}
Could you please to give me a hint of how it can be implemented and in what way should i look?
Thanx in advance, Jan.