how to record audio as mp3 file by using AvAudiorecorder

Alok SInha picture Alok SInha · Apr 25, 2012 · Viewed 14.7k times · Source

how to record audio as mp3 file by using AvAudiorecorder.i m using following code for recorder setting

recordSetting1 =  [NSDictionary dictionaryWithObjectsAndKeys:
                  [NSNumber numberWithInt:AVAudioQualityMin],AVEncoderAudioQualityKey,
                  [NSNumber numberWithInt:16], 
                   AVEncoderBitRateKey,
                   [NSNumber numberWithInt: 2], 
                   AVNumberOfChannelsKey,
                   [NSNumber numberWithFloat:44100.0], 
                   AVSampleRateKey,nil];

Answer

nostalgia.dl picture nostalgia.dl · Apr 25, 2012

Add

[NSNumber numberWithInt:kAudioFormatMPEGLayer3] forKey:AVFormatIDKey

However it's impossible to encode mp3 format at IPhone because of royalty.