how to record audio as mp3 file by using AvAudiorecorder

后端 未结 2 1568
说谎
说谎 2021-01-02 04:41

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

recordSetting1 =  [NSDictionary dictionaryWithObjectsA         


        
相关标签:
2条回答
  • 2021-01-02 05:19

    Whilst you can play MP3 files using AVAudioPlayer, you can't record in MP3 format with AVAudioRecorder (see this SO post and this SO post). If you need a compressed format, but it doesn't have to be MP3, I suggest recording in AAC format.

    0 讨论(0)
  • 2021-01-02 05:39

    Add

    [NSNumber numberWithInt:kAudioFormatMPEGLayer3] forKey:AVFormatIDKey
    

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

    0 讨论(0)
提交回复
热议问题