i'm working on an iPhone project and wants to save mp3 files instead of car, i wrote this code to save record files in .caf extensions:
NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init];
[recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];
NSString *recorderFilePath =[NSString stringWithFormat:@"%@/%@.caf", DOCUMENTS_FOLDER,fileName];
i tried this:
[recordSetting setValue :[NSNumber numberWithInt:kAudioFormatMPEGLayer3] forKey:AVFormatIDKey];
NSString *recorderFilePath =[NSString stringWithFormat:@"%@/%@.mp3", DOCUMENTS_FOLDER,fileName];
but it didn't save in mp3 format! is it available in objective c or there's any third party code that makes that, i see that method in AudioToolbox.framework:
OSStatus AudioConverterConvertBuffer (
AudioConverterRef inAudioConverter,
UInt32 inInputDataSize,
const void *inInputData,
UInt32 *ioOutputDataSize,
void *outOutputData
);
any help is welcomed,thanks.