简体   繁体   中英

AVAudioRecorder Default Record Setting

I am recording the audio using AVAudioRecorder. I am using the below code :

[[AVAudioRecorder alloc] initWithURL:outputFileURL settings:recordSetting error:NULL];

I want to know If I pass recordSetting as nil, then what is the default record setting which this Recorder use. I mean what will be the values of AVFormatIDKey, AVSampleRateKey, AVEncoderBitRateKey, AVNumberOfChannelsKey and AVAudioQualityMax if we pass in settings parameter as nil.

I need the default values of these keys.

I would appreciate any help.

Following are the default recorder settings which you can set.

NSMutableDictionary recordSetting = [[NSMutableDictionary alloc] init];

[recordSetting setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];

Default AVAudioRecorder Setting is following;

defaultSettings =     {
    AVFormatIDKey = 1768775988;
    AVLinearPCMBitDepthKey = 16;
    AVLinearPCMIsBigEndianKey = 0;
    AVLinearPCMIsFloatKey = 0;
    AVNumberOfChannelsKey = 2;
    AVSampleRateKey = 44100;
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM