如何在swift中提高AV录制质量。我想要高清录制

时间:2017-09-25 07:07:20

标签: ios swift avaudiorecorder

bellow是我目前的AVRecorder设置,我想改进它以获得最高质量的录制。

let settings = [
                    AVFormatIDKey: Int(kAudioFormatMPEG4AAC),
                    AVSampleRateKey: 44100,
                    AVNumberOfChannelsKey: 2,
                    AVEncoderAudioQualityKey: AVAudioQuality.max.rawValue
                ]

2 个答案:

答案 0 :(得分:1)

试试这个..

// this effects the quality of video
session?.sessionPreset = AVCaptureSessionPresetHigh

您有更多选项可以配置AVCaptureSession.sessionPreset属性,请参阅图片。

enter image description here

答案 1 :(得分:1)

改善AV录制质量更改格式IDKey: kAudioFormatAppleLossless

let settings = [
                        AVFormatIDKey: kAudioFormatAppleLossless,
                        AVSampleRateKey:44100.0,
                        AVNumberOfChannelsKey:2,
                        AVEncoderAudioQualityKey:AVAudioQuality.max.rawValue
               ]