What are the actual keys / settings for AVAudioRecorder?

I am working on a Swift application for macOS that uses AVAudioRecorder . the initializer method of this class can use the dictionary 'settings' . In the relevant AV documents, all links to URL-less, plain-text, where these keys / values ​​of these parameters are determined using instructions such as:

For information on the settings available for the VCR, see AV Audio File Settings Constants.

I searched a lot for this document and did not find it. I actually sent an Apple feedback report, requiring them to update their API documents with links to this document, which were mentioned in many places, but only by name.

I tried many times to search. I used Apple's own search function on my developer's site, and I searched for API documents in Xcode itself. This effort did not find a document called AV Foundation Audio Settings Constants, but I can find many documents that reference it with that name.

Does anyone know where this mystical API document actually exists?

+4
source share
1 answer

I did not find the actual authoritative document about this, here is just a list of running parameters that I have encountered so far:

AVFormatIDKey : kAudioFormatAppleLossless, kAudioFormatMPEG4AAC

AVNumberOfChannelsKey : 2

AVSampleRateKey : 44100.0

AVEncoderBitRateKey: 192000, 320000

AVEncoderAudioQualityKey : AVAudioQuality.min.rawValue, AVAudioQuality.max.rawValue


Here's an example of a Swift to create a settings dictionary with some of the following values:

let settings:[String : Any] = [ AVFormatIDKey : kAudioFormatAppleLossless,
    AVEncoderAudioQualityKey : AVAudioQuality.max.rawValue,
    AVEncoderBitRateKey: 320000,
    AVNumberOfChannelsKey : 2,
    AVSampleRateKey : 44100.0 ] as [String : Any]

, . , , .

+1

Source: https://habr.com/ru/post/1691726/


All Articles