AVAudioRecorder - Proper MPEG4 AAC Recording Settings

前端 未结 3 801
悲&欢浪女
悲&欢浪女 2021-02-06 04:52

I\'ve got a live app with an estimated 15% of users reporting that the record feature is not working. This isn\'t happening on our test devices, but the reports show that the p

3条回答
  •  天涯浪人
    2021-02-06 05:38

    Try this settings which i used to record MPEG 4 AAC format...Its working good..

    NSString *tempDir = NSTemporaryDirectory();
    NSString *soundFilePath = [tempDir stringByAppendingPathComponent:@"sound.m4a"];
    
    NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];
    NSDictionary *recordSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                                      [NSNumber numberWithInt:kAudioFormatMPEG4AAC], AVFormatIDKey,
                                      [NSNumber numberWithInt:AVAudioQualityMin], AVEncoderAudioQualityKey,
                                      [NSNumber numberWithInt: 1], AVNumberOfChannelsKey,
                                      [NSNumber numberWithFloat:8000.0], AVSampleRateKey,
                                      nil];
    

提交回复
热议问题