如何在iOS中为AVCaptureAudioDataOutput设置音频设置

pra*_*epa 6 iphone ios avcapturesession

我想为AVCaptureAudioDataOutput设置以下audioSettings,我该怎么做?

 NSMutableDictionary *recordSettings = [[NSMutableDictionary alloc] initWithCapacity:10];
    [recordSettings setObject:[NSNumber numberWithInt: kAudioFormatLinearPCM] forKey: AVFormatIDKey];
    [recordSettings setObject:[NSNumber numberWithFloat:44100] forKey: AVSampleRateKey];
    [recordSettings setObject:[NSNumber numberWithInt:1] forKey:AVNumberOfChannelsKey];
    [recordSettings setObject:[NSNumber numberWithInt:705600] forKey:AVEncoderBitRateKey];
    [recordSettings setObject:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];

self.audioRecorder = [[[ AVAudioRecorder alloc] initWithURL:[NSURL fileURLWithPath:self.audioRecorderDestinationFilePath] settings:recordSettings error:nil]autorelease];
Run Code Online (Sandbox Code Playgroud)

[recordSettings release];