Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does AVEncoderAudioQualityKey do?

According to the scanty docs, the AVEncoderAudioQualityKeys are --

Keys that specify sample rate conversion quality, used for the AVSampleRateConverterAudioQualityKey property.

enum {
   AVAudioQualityMin       = 0,
   AVAudioQualityLow       = 0x20,
   AVAudioQualityMedium    = 0x40,
   AVAudioQualityHigh      = 0x60,
   AVAudioQualityMax       = 0x7F
};
typedef NSInteger AVAudioQuality;

Testing with AVAudioRecorder, there is virtually no difference in resulting audio file size or quality for a 2 minute recording recorded with AVAudioQualityMin versus one recorded with AVAudioQualityMax. The test used an 8KHz sample rate using kAudioFormatMPEG4AAC.

Can someone enlighten me as to the theoretical and practical purpose of this key?

like image 345
memmons Avatar asked Aug 31 '11 15:08

memmons


1 Answers

These keys are used for specifying quality in sample rate conversions. Audio file format, which specifies the sample rate and bit depth, determines your file size. According to the Apple docs they are:

Keys that specify sample rate conversion quality, used for the AVSampleRateConverterAudioQualityKey property.

So, these quality keys only determine how well you want to re-sample audio into another format.

read more

like image 122
Patrick Goley Avatar answered Oct 18 '22 09:10

Patrick Goley