Audio File Properties

Properties used by the functions described in getting and setting pieces of data in audio files. See Working with Global Information for details.


enum : AudioFilePropertyID {




The format of the audio data file.


An audio stream basic description containing the format of the audio data.


To support formats such as AAC SBR in which an encoded data stream can be decoded to multiple destination formats, this property’s value is an array of audio format list item values (declared in AudioFormat.h) of those formats. Typically, this is an audio format list item with the same audio stream basic description in the kAudioFilePropertyDataFormat property.


Indicates whether a designated audio file has been optimized, that is, ready to start having sound data written to it. A value of 0 indicates the file needs to be optimized. A value of 1 indicates the file is currently optimized.


A pointer to memory set up by the caller. Some file types require that a magic cookie be provided before packets can be written to an audio file. Set this property before you call AudioFileWriteBytes or AudioFileWritePackets if a magic cookie exists.


Indicates the number of bytes of audio data in the designated file.


Indicates the number of packets of audio data in the designated file.


Indicates the maximum size of a packet for the data in the designated file.


Indicates the byte offset in the file of the designated audio data.


An audio channel layout structure.


The default value (0) always updates header. If set to 1, updating the files sizes in the header is not performed every time data is written. Instead, the updating is deferred until the file has been read, optimized, or closed. This process is more efficient, but not as safe. If an application crashes before the size has been updated, the file might not be readable.


This constant is deprecated in macOS 10.5 and later. Do not use. Instead, use kAudioFormatProperty_FormatName (declared in the AudioFormat.h header file).


A list of CFStringRef objects representing audio file markers defined in the file.


The list of audio file region values defined in the file.


Passes an audio frame packet translation structure with the mPacket field filled out and returns the mFrame field. The mFrameOffsetInPacket field is ignored.


Passes an audio frame packet translation structure with the mFrame field filled out and returns the mPacket and mFrameOffsetInPacket fields.


Passes an audio byte packet translation structure with the mPacket field filled out and returns the mByte field. The mByteOffsetInPacket field is ignored. If the value in the mByte field is an estimate then the kBytePacketTranslationFlag_IsEstimate flag is set in the mFlags field.


Passes an audio byte packet translation structure with the mByte field filled out and returns the mPacket and mByteOffsetInPacket fields. If the value in the mByte field is an estimate then the kBytePacketTranslationFlag_IsEstimate flag is set in the mFlags field.


An array of four-character codes for each kind of chunk in the file.


A CF Dictionary with information about the data in the file.


Gets or sets an audio file packet table information structure for its supporting file types. When setting the structure, the sum of the values of the mNumberValidFrames, mPrimingFrames and mRemainderFrames fields must be the same as the total number of frames in all packets. If not, a paramErr is returned. To ensure this result, get the value of the property and make sure the sum of the three values you set has the same sum as the three values you got.


The theoretical maximum packet size in the file. This value is obtained without actually scanning the whole file to find the largest packet, as could happen with kAudioFilePropertyMaximumPacketSize.


The duration in seconds of the data expected to be written. Set this property before any data has been written to reserve space in the file header for a packet table and other information to appear before the audio data. Otherwise, the packet table might get written at the end of the file, preventing the file from being streamable.


An estimated duration in seconds. If this duration can be calculated without scanning the entire file, or all the audio data packets have been scanned, the value accurately reflects the duration of the audio data.


The actual bit rate (number of audio data bits in the file divided by the duration of the file) for some file types, and the nominal bit rate (which bit rate the encoder was set to) for others.


A void* value pointing to memory set up by your application to contain a fully formatted ID3 tag.


For compressed data, this property’s value is the bit depth of the source, uncompressed audio stream as an SInt32 value, if known. The bit depth is expressed as a negative number if the uncompressed source was in a floating point format. For example, a property value of -32 is used for float and a property value of -64 represents double.


A CFDataRef object containing an image file associated with the audio file.