Structs



AudioFile_SMPTE_Time


A struct for describing a SMPTE time.

struct AudioFile_SMPTE_Time { 
    SInt8 mHours; 
    UInt8 mMinutes; 
    UInt8 mSeconds; 
    UInt8 mFrames; 
    UInt32 mSubFrameSampleOffset; 
}; 
Field Descriptions
mHours
The hours.
mMinutes
The minutes.
mSeconds
The seconds.
mFrames
The frames.
mSubFrameSampleOffset
The sample offset within a frame.

AudioFileMarker


A marker annotates a position in an audio file with additional information.

struct AudioFileMarker { 
    Float64 mFramePosition;  
    CFStringRef mName; 
    SInt32 mMarkerID;  
    AudioFile_SMPTE_Time mSMPTETime; 
    UInt32 mType; 
    UInt16 mReserved; 
    UInt16 mChannel; 
}; 
Field Descriptions
mFramePosition
The frame in the file counting from the start of the audio data.
mName
The name of this marker.
mMarkerID
A unique ID for this marker.
mSMPTETime
The SMPTE time for this marker.
mType
The marker type.
mReserved
A reserved field. Set to zero.
mChannel
The channel number that the marker refers to. Set to zero if marker applies to all channels.
Discussion

(description)


AudioFileMarkerList


(description)

struct AudioFileMarkerList { 
    UInt32 mSMPTE_TimeType; 
    UInt32 mNumberMarkers; 
    AudioFileMarker mMarkers[kVariableLengthArray]; 
}; 
Field Descriptions
(name) (description)
Discussion

(description)


AudioFileRegion


An AudioFileRegion specifies a segment of audio data.

struct AudioFileRegion { 
    UInt32 mRegionID; 
    CFStringRef mName; 
    UInt32 mFlags; 
    UInt32 mNumberMarkers; 
    AudioFileMarker mMarkers[kVariableLengthArray]; 
}; 
Field Descriptions
mRegionID
each region must have a unique ID.
mName
The name of the region.
mFlags
AudioFileRegionFlags.
mNumberMarkers
The number of markers in the mMarkers array.
mMarkers
A variable length array of AudioFileMarkers.
Discussion

Generally a region consists of at least two markers marking the beginning and end of the segment. There may also be other markers defining other meta information such as sync point.


AudioFileRegionList


A list of the AudioFileRegions in a file.

struct AudioFileRegionList { 
    UInt32 mSMPTE_TimeType; 
    UInt32 mNumberRegions; 
    AudioFileRegion mRegions[kVariableLengthArray]; 
}; 
Field Descriptions
mSMPTE_TimeType
This defines the SMPTE timing scheme used in the file. See CAFFile.h for the values used here.
mNumberRegions
The number of regions in the mRegions list.
mRegions
A list of AudioFileRegions. Note that AudioFileMarkers are variable length, so this list cannot be accessed as an array. Use the NextAudioFileRegion macro for traversing the list instead.
Discussion

This is the struct used by the kAudioFilePropertyRegionList property.


AudioFramePacketTranslation


used for properties kAudioFilePropertyPacketToFrame and kAudioFilePropertyFrameToPacket

struct AudioFramePacketTranslation { 
    SInt64 mFrame; 
    SInt64 mPacket; 
    UInt32 mFrameOffsetInPacket; 
}; 
Field Descriptions
mFrame
a frame number.
mPacket
a packet number.
mFrameOffsetInPacket
a frame offset in a packet.
Discussion

See description of kAudioFilePropertyPacketToFrame and kAudioFilePropertyFrameToPacket


AudioFilePacketTableInfo


This contains information about the number of valid frames in a file and where they begin and end.

struct AudioFilePacketTableInfo { 
    SInt64 mNumberValidFrames; 
    SInt32 mPrimingFrames; 
    SInt32 mRemainderFrames; 
}; 
Field Descriptions
mNumberValidFrames
the number of valid frames in the file.
mPrimingFrames
the number of invalid frames at the beginning of the file.
mRemainderFrames
the number of invalid frames at the end of the file.
Discussion

Some data formats may have packets whose contents are not completely valid, but represent priming or remainder frames that are not meant to be played. For example a file with 100 packets of AAC is nominally 1024 * 100 = 102400 frames of data. However the first 2112 frames of that may be priming frames and there may be some number of remainder frames added to pad out to a full packet of 1024 frames. The priming and remainder frames should be discarded. The total number of packets in the file times the frames per packet (or counting each packet's frames individually for a variable frames per packet format) minus mPrimingFrames, minus mRemainderFrames, should equal mNumberValidFrames.


AudioFileTypeAndFormatID


This is used as a specifier for kAudioFileGlobalInfo_AvailableStreamDescriptions

struct AudioFileTypeAndFormatID { 
    AudioFileTypeID mFileType; 
    UInt32 mFormatID; 
}; 
Field Descriptions
mFileType
a four char code for the file type such as kAudioFileAIFFType, kAudioFileCAFType, etc.
mFormatID
a four char code for the format ID such as kAudioFormatLinearPCM, kAudioFormatMPEG4AAC, etc.
Discussion

This struct is used to specify a desired audio file type and data format ID so that a list of stream descriptions of available formats can be obtained.

(Last Updated July 18, 2005)