Specifies the recommended settings for use with an AVAsset
.
SDKs
- iOS 7.0+
- macOS 10.15+
- Mac Catalyst 13.0+
Framework
- AVFoundation
Declaration
func recommendedAudioSettingsForAssetWriter(writingTo outputFileType: AVFile Type) -> [Any Hashable : Any]?
Parameters
outputFileType
Specifies the UTI of the file type to be written. See File Format UTIs for the defined UTIs.
Return Value
A fully populated dictionary of keys and values that are compatible with AVAsset
.
Discussion
The value of this property is an NSDictionary
containing values for compression settings keys defined in Audio Settings and Formats. This dictionary is suitable for use as the asset
method’s output
parameter when creating an AVAsset
; for example,
[AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeAudio outputSettings:outputSettings sourceFormatHint:hint];
The dictionary returned contains all necessary keys and values needed to create an AVAsset
instance; see the init(media
method for a more in depth discussion. For QuickTime movie and ISO files, the recommended audio settings will always produce output comparable to that of AVCapture
.
The dictionary of settings is dependent on the current configuration of the receiver's AVCapture
and its inputs. The settings dictionary may change if the session's configuration changes. As such, you should configure your session first, then query the recommended audio settings.