Consolidates audio data and performs other internal optimizations of the file structure.
- iOS 2.0+
- macOS 10.2+
- Mac Catalyst 13.0+
- tvOS 9.0+
The audio file you want to optimize.
A result code. See Result Codes.
This function optimizes the file so additional audio information can be appended to the existing data. Typically, this function consolidates the file’s audio data at the end of the file. This improves performance, such as when writing additional data to the file.
Do not use this potentially expensive and time-consuming operation during time-critical operations. Instead, use the
k property to check the optimization state of a file. You can then optimize when it won’t adversely affect your application.