what are the formats supported in AVAudioRecorder for recording sound?

前端 未结 2 1365
生来不讨喜
生来不讨喜 2020-12-24 10:13

I have found a list of the different values (Audio Data Format) at http://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/CoreAudioDataTypesRef/Reference

2条回答
  •  忘掉有多难
    2020-12-24 10:25

    List above just

    currently defined values for the mFormatID field

    not supported for recording.

    There are tested with AVAudioRecorder formats (with sample rates):

    "MPEG4AAC (8000, 11025, 22050, 32000, 44100, 48000)",
    "AppleLossless (8000, 11025, 22050, 32000, 44100, 48000)",
    "MPEG4AAC_HE (32000, 44100, 48000)",
    "MPEG4AAC_LD (22050, 32000, 44100, 48000)",
    "MPEG4AAC_ELD (22050, 32000, 44100, 48000)",
    "MPEG4AAC_ELD_SBR (22050, 32000, 44100, 48000)",
    "MPEG4AAC_ELD_V2 (22050, 32000, 44100, 48000)"
    

    Example:

    [[AVAudioRecorder alloc] initWithURL:outputFileURL
                                settings:@{
                                           AVFormatIDKey : @(kAudioFormatMPEG4AAC),
                                           AVSampleRateKey : @(44100.0),
                                           AVNumberOfChannelsKey : @(2)
                                           }
                                   error:&error];
    

    also Supported Audio file formats

提交回复
热议问题