Search code examples
iosswiftavaudiorecorder

how to improve AV recording quality in swift. i want HD recording


bellow is my current AVRecorder settings, I want to improve it to have the highest quality of the recording.

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

Solution

  • To improve AV Recording quality change formatIDKey : kAudioFormatAppleLossless

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