How to record audio as mp3 file by using AvAudiorecorder in iOS

avaudiorecorder, iphone, record

Solution

Add

[NSNumber numberWithInt:kAudioFormatMPEGLayer3] forKey:AVFormatIDKey

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

Problem

How to record audio as an mp3 file by using AvAudiorecorder? I am using the following code for the recorder setting ``` recordSetting = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:AVAudioQualityMin],AVEncoderAudioQualityKey, [NSNumber numberWithInt:16], AVEncoderBitRateKey, [NSNumber numberWithInt: 2], AVNumberOfChannelsKey, [NSNumber numberWithFloat:44100.0], AVSampleRateKey, nil]; ```

Original source

Related problems