The iPhone OS supports recording a .caf file using a number of different compressed audio encoding formats:
Apple Lossless - kAudioFormatAppleLossless
iLBC (Internet Low Bitrate Codec) - kAudioFormatiLBC
IMA/ADPCM (aka IMA4) - kAudioFormatAppleIMA4
µLaw - kAudioFormatULaw
aLaw - kAudioFormatALaw
- (id) initWithURL: fileURL {
NSLog (@"initializing a recorder object.");
self = [super init];
if (self != nil) {
// define the audio stream basic description for the file to record into
// record audio at the current hardware sample rate
// make sure the audio session is active before asking for properties
UInt32 propertySize = sizeof(audioFormat.mSampleRate);
AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareSampleRate,
&propertySize,
&audioFormat.mSampleRate);
audioFormat.mFormatID = kAudioFormatAppleIMA4; // record using IMA4 codec
audioFormat.mChannelsPerFrame = 1;
AudioQueueNewInput(&audioFormat, ... );
...
}
return self;
}
You'll definitely want to read the Audio Queue Services Programming Guide