<!--
{
  "documentType" : "article",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/1576499-audio-file-properties",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Audio File Properties"
}
-->

# 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.

## Topics

### Constants

[`kAudioFilePropertyFileFormat`](/documentation/AudioToolbox/kAudioFilePropertyFileFormat)

The format of the audio data file.

[`kAudioFilePropertyDataFormat`](/documentation/AudioToolbox/kAudioFilePropertyDataFormat)

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

[`kAudioFilePropertyFormatList`](/documentation/AudioToolbox/kAudioFilePropertyFormatList)

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.

[`kAudioFilePropertyIsOptimized`](/documentation/AudioToolbox/kAudioFilePropertyIsOptimized)

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.

[`kAudioFilePropertyMagicCookieData`](/documentation/AudioToolbox/kAudioFilePropertyMagicCookieData)

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(_:_:_:_:_:)`](/documentation/AudioToolbox/AudioFileWriteBytes(_:_:_:_:_:)) or [`AudioFileWritePackets(_:_:_:_:_:_:_:)`](/documentation/AudioToolbox/AudioFileWritePackets(_:_:_:_:_:_:_:)) if a magic cookie exists.

[`kAudioFilePropertyAudioDataByteCount`](/documentation/AudioToolbox/kAudioFilePropertyAudioDataByteCount)

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

[`kAudioFilePropertyAudioDataPacketCount`](/documentation/AudioToolbox/kAudioFilePropertyAudioDataPacketCount)

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

[`kAudioFilePropertyMaximumPacketSize`](/documentation/AudioToolbox/kAudioFilePropertyMaximumPacketSize)

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

[`kAudioFilePropertyDataOffset`](/documentation/AudioToolbox/kAudioFilePropertyDataOffset)

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

[`kAudioFilePropertyChannelLayout`](/documentation/AudioToolbox/kAudioFilePropertyChannelLayout)

An audio channel layout structure.

[`kAudioFilePropertyDeferSizeUpdates`](/documentation/AudioToolbox/kAudioFilePropertyDeferSizeUpdates)

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.

[`kAudioFilePropertyDataFormatName`](/documentation/AudioToolbox/kAudioFilePropertyDataFormatName)

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

[`kAudioFilePropertyMarkerList`](/documentation/AudioToolbox/kAudioFilePropertyMarkerList)

A list of audio file markers defined in the file.

[`kAudioFilePropertyRegionList`](/documentation/AudioToolbox/kAudioFilePropertyRegionList)

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

[`kAudioFilePropertyPacketToFrame`](/documentation/AudioToolbox/kAudioFilePropertyPacketToFrame)

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

[`kAudioFilePropertyFrameToPacket`](/documentation/AudioToolbox/kAudioFilePropertyFrameToPacket)

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

[`kAudioFilePropertyPacketToByte`](/documentation/AudioToolbox/kAudioFilePropertyPacketToByte)

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.

[`kAudioFilePropertyByteToPacket`](/documentation/AudioToolbox/kAudioFilePropertyByteToPacket)

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.

[`kAudioFilePropertyChunkIDs`](/documentation/AudioToolbox/kAudioFilePropertyChunkIDs)

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

[`kAudioFilePropertyInfoDictionary`](/documentation/AudioToolbox/kAudioFilePropertyInfoDictionary)

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

[`kAudioFilePropertyPacketTableInfo`](/documentation/AudioToolbox/kAudioFilePropertyPacketTableInfo)

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.

[`kAudioFilePropertyPacketSizeUpperBound`](/documentation/AudioToolbox/kAudioFilePropertyPacketSizeUpperBound)

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`.

[`kAudioFilePropertyReserveDuration`](/documentation/AudioToolbox/kAudioFilePropertyReserveDuration)

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.

[`kAudioFilePropertyEstimatedDuration`](/documentation/AudioToolbox/kAudioFilePropertyEstimatedDuration)

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.

[`kAudioFilePropertyBitRate`](/documentation/AudioToolbox/kAudioFilePropertyBitRate)

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.

[`kAudioFilePropertyID3Tag`](/documentation/AudioToolbox/kAudioFilePropertyID3Tag)

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

[`kAudioFilePropertySourceBitDepth`](/documentation/AudioToolbox/kAudioFilePropertySourceBitDepth)

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`.

[`kAudioFilePropertyAlbumArtwork`](/documentation/AudioToolbox/kAudioFilePropertyAlbumArtwork)

An object containing the image data for the album artwork associated with an audio file.

[`kAudioFilePropertyAudioTrackCount`](/documentation/AudioToolbox/kAudioFilePropertyAudioTrackCount)

[`kAudioFilePropertyUseAudioTrack`](/documentation/AudioToolbox/kAudioFilePropertyUseAudioTrack)

[`kAudioFilePropertyID3TagOffset`](/documentation/AudioToolbox/kAudioFilePropertyID3TagOffset)

[`kAudioFilePropertyNextIndependentPacket`](/documentation/AudioToolbox/kAudioFilePropertyNextIndependentPacket)

[`kAudioFilePropertyPacketRangeByteCountUpperBound`](/documentation/AudioToolbox/kAudioFilePropertyPacketRangeByteCountUpperBound)

[`kAudioFilePropertyPacketToDependencyInfo`](/documentation/AudioToolbox/kAudioFilePropertyPacketToDependencyInfo)

[`kAudioFilePropertyPacketToRollDistance`](/documentation/AudioToolbox/kAudioFilePropertyPacketToRollDistance)

[`kAudioFilePropertyPreviousIndependentPacket`](/documentation/AudioToolbox/kAudioFilePropertyPreviousIndependentPacket)

[`kAudioFilePropertyRestrictsRandomAccess`](/documentation/AudioToolbox/kAudioFilePropertyRestrictsRandomAccess)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)