2
votes

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.

2

2 Answers

0
votes

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];
0
votes

Default AVAudioRecorder Setting is following;

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