0
我想在iOS的(AVAudioRecorder)
录制下面的代码的音频工作记录罚款AVAudioRecorder 256 Kbps的iOS中
_fileName = [NSString stringWithFormat:@"Record_%@.m4a",[DateAndTimeUtil stringFromDate:[NSDate date] withFormatterString:@"HH_mm_ss_dd_MM_yyyy"]];NSArray *pathComponents = [NSArray arrayWithObjects:
[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject],
_fileName,
nil];
NSURL *outputFileURL = [NSURL fileURLWithPathComponents:pathComponents];
// Setup audio session
AVAudioSession *session = [AVAudioSession sharedInstance];
[session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
// Define the recorder setting
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];
// Initiate and prepare the recorder
audioRecorder = [[AVAudioRecorder alloc] initWithURL:outputFileURL settings:recordSetting error:nil];
audioRecorder.delegate = self;
audioRecorder.meteringEnabled = YES;
[audioRecorder prepareToRecord];`
的问题是,录制的文件显示比特率设置为44 Kbps的,但我想记录的音频平均比特率为256Kbps,首选AAC编解码器,但也兼容MP3编解码器和MP4音频编解码器。
请帮我一把。