Q:

How to reduce audio file size

I have a recorder to record Microphone but i'm getting high file size, I would like to reduce the size with high quality file.
Here is the recording settings: This settings works and i can play the audio but it has high size.
AVFormatIDKey:NSNumber(value: kAudioFormatAppleLossless),
AVEncoderAudioQualityKey : AVAudioQuality.max.rawValue,
AVEncoderBitRateKey : 12000,
AVNumberOfChannelsKey: 2,
AVSampleRateKey : 44100

I have tried to use kAudioFormatMPEG4AAC With this i'm always gettings 28b of size, But i couldn't get it to play there is an error:

The operation couldn’t be completed. (OSStatus error 1685348671.)

Could someone please explain what is going on or how can i get high quality with lowest size?

A:

You have this error because of the wrong file format or other URL problem. Just change it accordingly. E.g you can remove AVFormatIDKey parameter and use .caf file extension.

