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

# Audio File Stream Properties

Audio file stream properties contain information that you can use to help interpret the audio data in a stream.

## Discussion

Use these property IDs when calling the `AudioFileStreamGetProperty` function.

## Topics

### Constants

[`var kAudioFileStreamProperty_ReadyToProducePackets: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_ReadyToProducePackets)

[`var kAudioFileStreamProperty_FileFormat: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_FileFormat)

A four-character code that identifies the audio data format.

[`var kAudioFileStreamProperty_DataFormat: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_DataFormat)

An `AudioStreamBasicDescription` structure describing the format of the audio data in the stream.

[`var kAudioFileStreamProperty_FormatList: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_FormatList)

To support formats such as AAC with SBR where an encoded data stream can be decoded to multiple destination formats, this property returns an array of `AudioFormatListItem` structures (declared in `AudioFormat.h`)—one for each of the destination formats. The default behavior is to return an `AudioFormatListItem` structure that has the same `AudioStreamBasicDescription` structure as that returned by the [`kAudioFileStreamProperty_DataFormat`](/documentation/AudioToolbox/kAudioFileStreamProperty_DataFormat) property.

[`var kAudioFileStreamProperty_MagicCookieData: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_MagicCookieData)

A pointer (`void *`) to a magic cookie. For audio file types that require a magic cookie before packets can be written to a file, you should get this property value before calling the [`AudioFileWriteBytes(_:_:_:_:_:)`](/documentation/AudioToolbox/AudioFileWriteBytes(_:_:_:_:_:)) or [`AudioFileWritePackets(_:_:_:_:_:_:_:)`](/documentation/AudioToolbox/AudioFileWritePackets(_:_:_:_:_:_:_:)) functions.

[`var kAudioFileStreamProperty_AudioDataByteCount: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_AudioDataByteCount)

A `UInt64` value indicating the number of bytes of audio data in the streamed file. This property is valid only if the number of bytes for the entire stream is known from the data parsed in the header. For some kinds of streams this property may have no value.

[`var kAudioFileStreamProperty_AudioDataPacketCount: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_AudioDataPacketCount)

A `UInt64` value indicating the number of packets of audio data in the streamed file.

[`var kAudioFileStreamProperty_MaximumPacketSize: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_MaximumPacketSize)

A `UInt32` value indicating the maximum packet size of the data in the streamed file.

[`var kAudioFileStreamProperty_DataOffset: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_DataOffset)

An `SInt64` value indicating the byte offset in the streamed file at which the audio data starts.

[`var kAudioFileStreamProperty_ChannelLayout: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_ChannelLayout)

An `AudioChannelLayout` structure.

[`var kAudioFileStreamProperty_PacketToFrame: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_PacketToFrame)

Obtains the frame number corresponding to a packet number.

[`var kAudioFileStreamProperty_FrameToPacket: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_FrameToPacket)

Obtains the packet number corresponding to a frame number.

[`var kAudioFileStreamProperty_PacketToByte: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_PacketToByte)

Obtains the byte number corresponding to a packet number. Pass an `AudioBytePacketTranslation` structure with the `mPacket` field filled in, and a value is returned in the `mByte` field. The `mByteOffsetInPacket` field of the `AudioBytePacketTranslation` structure is ignored. If the `mByte` value is an estimate, then the `kBytePacketTranslationFlag_IsEstimate` value will be set in the `mFlags` field.

[`var kAudioFileStreamProperty_ByteToPacket: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_ByteToPacket)

Obtains the packet number corresponding to a byte number. Pass an `AudioBytePacketTranslation` structure with the `mByte` field filled in, and values are returned in the `mPacket` and `mByteOffsetInPacket` fields. If the `mPacket` value is an estimate, then the `kBytePacketTranslationFlag_IsEstimate` value will be set in the `mFlags` field.

[`var kAudioFileStreamProperty_PacketTableInfo: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_PacketTableInfo)

An `AudioFilePacketTableInfo` structure.

[`var kAudioFileStreamProperty_PacketSizeUpperBound: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_PacketSizeUpperBound)

A `UInt32` value indicating the theoretical maximum packet size in the streamed file. This value is useful for determining minimum buffer sizes, for example.

[`var kAudioFileStreamProperty_AverageBytesPerPacket: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_AverageBytesPerPacket)

A `Float64` value indicating the average bytes per packet. For CBR and files with packet tables, this number will be exact. Otherwise, it is a running average of packets parsed.

[`var kAudioFileStreamProperty_BitRate: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_BitRate)

A `UInt32` value indicating the bit rate of a stream in bits per second.

[`var kAudioFileStreamProperty_InfoDictionary: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_InfoDictionary)

[`var kAudioFileStreamProperty_NextIndependentPacket: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_NextIndependentPacket)

[`var kAudioFileStreamProperty_PacketToDependencyInfo: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_PacketToDependencyInfo)

[`var kAudioFileStreamProperty_PacketToRollDistance: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_PacketToRollDistance)

[`var kAudioFileStreamProperty_PreviousIndependentPacket: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_PreviousIndependentPacket)

[`var kAudioFileStreamProperty_RestrictsRandomAccess: AudioFileStreamPropertyID`](/documentation/AudioToolbox/kAudioFileStreamProperty_RestrictsRandomAccess)



---

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)