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

15,353

Add

[NSNumber numberWithInt:kAudioFormatMPEGLayer3] forKey:AVFormatIDKey

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

Share:
15,353
Alok Chandra
Author by

Alok Chandra

Result-oriented Senior iOS professional having 7+ years of experience leading the creation of complex,user-focused software applications at the highest level of quality and efficiency. Experience in creating unique and modern mobile applications in the App Store.

Updated on June 26, 2022

Comments

  • Alok Chandra
    Alok Chandra almost 2 years

    How to record audio as an mp3 file by using AvAudiorecorder?.I m 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];
    
  • Alok Chandra
    Alok Chandra about 12 years
    Thanks for your feedback i used this but i m getting error "Error Domain=NSOSStatusErrorDomain Code=1718449215 "The operation couldn’t be completed. (OSStatus error 1718449215.)" .please provide me complete setting code,if possible,thanks in advance.