Enumerations



Audio File Types


Constants for the built-in audio file types.

enum { 
    kAudioFileAIFFType = 'AIFF', 
    kAudioFileAIFCType = 'AIFC', 
    kAudioFileWAVEType = 'WAVE', 
    kAudioFileSoundDesigner2Type = 'Sd2f', 
    kAudioFileNextType = 'NeXT', 
    kAudioFileMP3Type = 'MPG3', 
    kAudioFileAC3Type = 'ac-3', 
    kAudioFileAAC_ADTSType = 'adts', 
    kAudioFileMPEG4Type = 'mp4f', 
    kAudioFileM4AType = 'm4af', 
    kAudioFileCAFType = 'caff' 
}; 
Constants
kAudioFileAIFFType
Audio Interchange File Format (AIFF)
kAudioFileAIFCType
Audio Interchange File Format Compressed (AIFF-C)
kAudioFileWAVEType
Microsoft WAVE
kAudioFileSoundDesigner2Type
Sound Designer II
kAudioFileNextType
NeXT / Sun
kAudioFileMP3Type
MPEG 2 Layer 3 (.mp3)
kAudioFileAC3Type
AC-3
kAudioFileAAC_ADTSType
Advanced Audio Coding (AAC) Audio Data Transport Stream (ADTS)
kAudioFileMPEG4Type
kAudioFileM4AType
kAudioFileCAFType
CoreAudio File Format.
Discussion

These constants are used to indicate the type of file to be written, or as a hint to what type of file to expect from data provided.


AudioFile


These are the error codes returned from the AudioFile API.

enum { 
    kAudioFileUnspecifiedError = 'wht?', 
    kAudioFileUnsupportedFileTypeError = 'typ?', 
    kAudioFileUnsupportedDataFormatError = 'fmt?', 
    kAudioFileUnsupportedPropertyError = 'pty?', 
    kAudioFileBadPropertySizeError = '!siz', 
    kAudioFilePermissionsError = 'prm?', 
    kAudioFileNotOptimizedError = 'optm', 
    // file format specific error codes 
    kAudioFileInvalidChunkError = 'chk?', 
    kAudioFileDoesNotAllow64BitDataSizeError = 'off?', 
    kAudioFileInvalidPacketOffsetError = 'pck?', 
    kAudioFileInvalidFileError = 'dta?', 
    kAudioFileOperationNotSupportedError = 0x6F703F3F // 'op??', integer used because of trigraph 
}; 
Constants
kAudioFileUnspecifiedError
An unspecified error has occurred.
kAudioFileUnsupportedFileTypeError
The file type is not supported.
kAudioFileUnsupportedDataFormatError
The data format is not supported by this file type.
kAudioFileUnsupportedPropertyError
The property is not supported.
kAudioFileBadPropertySizeError
The size of the property data was not correct.
kAudioFilePermissionsError
The operation violated the file permissions. For example, trying to write to a file opened with fsRdPerm.
kAudioFileNotOptimizedError
There are chunks following the audio data chunk that prevent extending the audio data chunk. The file must be optimized in order to write more audio data.
kAudioFileInvalidChunkError
The chunk does not exist in the file or is not supported by the file.
kAudioFileDoesNotAllow64BitDataSizeError
The a file offset was too large for the file type. AIFF and WAVE have a 32 bit file size limit.
kAudioFileInvalidPacketOffsetError
A packet offset was past the end of the file, or not at the end of the file when writing a VBR format, or a corrupt packet size was read when building the packet table.
kAudioFileInvalidFileError
The file is malformed, or otherwise not a valid instance of an audio file of its type.
kAudioFileOperationNotSupportedError
The operation cannot be performed. For example, setting kAudioFilePropertyAudioDataByteCount to increase the size of the audio data in a file is not a supported operation. Write the data instead.
Discussion

error codes


AudioFileLoopDirection


These constants describe the playback direction of a looped segment of a file.

enum { 
    kAudioFileLoopDirection_NoLooping = 0, 
    kAudioFileLoopDirection_Forward = 1, 
    kAudioFileLoopDirection_ForwardAndBackward = 2, 
    kAudioFileLoopDirection_Backward = 3 
}; 
Constants
kAudioFileLoopDirection_NoLooping
The segment is not looped.
kAudioFileLoopDirection_Forward
play segment forward.
kAudioFileLoopDirection_Backward
play segment backward.
kAudioFileLoopDirection_ForwardAndBackward
play segment forward and backward.

AudioFileMarkerType


constants for types of markers within a file. Used in the mType field of AudioFileMarker.

enum { 
    kAudioFileMarkerType_Generic = 0, 
}; 
Constants
kAudioFileMarkerType_Generic
A generic marker. See CAFFile.h for marker types specific to CAF files.

AudioFileRegionFlags


These are flags for an AudioFileRegion that specify a playback direction.

enum { 
    kAudioFileRegionFlag_LoopEnable = 1, 
    kAudioFileRegionFlag_PlayForward = 2, 
    kAudioFileRegionFlag_PlayBackward = 4 
}; 
Constants
kAudioFileRegionFlag_LoopEnable
If this flag is set, the region will be looped. One or both of the following must also be set.
kAudioFileRegionFlag_PlayForward
If this flag is set, the region will be played forward.
kAudioFileRegionFlag_PlayBackward
If this flag is set, the region will be played backward.
Discussion

One or multiple of these flags can be set. For example, if both kAudioFileRegionFlag_LoopEnable and kAudioFileRegionFlag_PlayForward are set, then the region will play as a forward loop. If only kAudioFileRegionFlag_PlayForward is set, then the region will be played forward once.


Audio


constants for AudioFile get/set property calls

enum { 
    kAudioFilePropertyFileFormat = 'ffmt', 
    kAudioFilePropertyDataFormat = 'dfmt', 
    kAudioFilePropertyIsOptimized = 'optm', 
    kAudioFilePropertyMagicCookieData = 'mgic', 
    kAudioFilePropertyAudioDataByteCount = 'bcnt', 
    kAudioFilePropertyAudioDataPacketCount = 'pcnt', 
    kAudioFilePropertyMaximumPacketSize = 'psze', 
    kAudioFilePropertyDataOffset = 'doff', 
    kAudioFilePropertyChannelLayout = 'cmap', 
    kAudioFilePropertyDeferSizeUpdates = 'dszu', 
    kAudioFilePropertyDataFormatName = 'fnme', 
    kAudioFilePropertyMarkerList = 'mkls', 
    kAudioFilePropertyRegionList = 'rgls', 
    kAudioFilePropertyPacketToFrame = 'pkfr', 
    kAudioFilePropertyFrameToPacket = 'frpk', 
    kAudioFilePropertyChunkIDs = 'chid', 
    kAudioFilePropertyInfoDictionary = 'info', 
    kAudioFilePropertyPacketTableInfo = 'pnfo' 
}; 
Constants
kAudioFilePropertyFileFormat
An AudioFileTypeID that identifies the format of the file
kAudioFilePropertyDataFormat
An AudioStreamBasicDescription describing the format of the audio data
kAudioFilePropertyIsOptimized
A UInt32 indicating whether an Audio File has been optimized. Optimized means it 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
A void * pointing to memory set up by the caller. Some file types require that a magic cookie be provided before packets can be written to the file, so this property should be set before calling AudioFileWriteBytes()/AudioFileWritePackets() if a magic cookie exists.
kAudioFilePropertyAudioDataByteCount
a UInt64 that indicates the number of bytes of audio data contained in the file
kAudioFilePropertyAudioDataPacketCount
a UInt64 that indicates the number of packets of audio data contained in the file
kAudioFilePropertyMaximumPacketSize
a UInt32 that indicates the maximum size of a packet for the data contained in the file
kAudioFilePropertyDataOffset
a SInt64 that indicates the byte offset in the file of the audio data.
kAudioFilePropertyChannelLayout
An AudioChannelLayout struct.
kAudioFilePropertyDeferSizeUpdates
A UInt32. If 1, then updating the files sizes in the header is not done for every write, but deferred until the file is read, optimized or closed. This is more efficient, but less safe since, if the application crashes before the size is updated, the file may not be readable. The default value is zero, it always updates header.
kAudioFilePropertyDataFormatName
This is deprecated. Use kAudioFormatProperty_FormatName in AudioFormat.h instead.
kAudioFilePropertyMarkerList
access the list of markers defined in the file. returns an AudioFileMarkerList. The CFStringRefs in the returned structs must be released by the client. (available in 10.2.4 and later)
kAudioFilePropertyRegionList
access the list of regions defined in the file. returns an Array of AudioFileRegions. The CFStringRefs in the returned structs must be released by the client. (available in 10.2.4 and later)
kAudioFilePropertyPacketToFrame
pass a AudioFramePacketTranslation with mPacket filled out and get mFrame back. mFrameOffsetInPacket is ignored.
kAudioFilePropertyFrameToPacket
pass a AudioFramePacketTranslation with mFrame filled out and get mPacket and mFrameOffsetInPacket back.
kAudioFilePropertyChunkIDs
returns an array of OSType four char codes for each kind of chunk in the file.
kAudioFilePropertyInfoDictionary
returns a CFDictionary filled with information about the data contined in the file. See dictionary key constants already defined for info string types. AudioFileComponents are free to add keys to the dictionaries that they return for this property... caller is responsible for releasing the CFObject
kAudioFilePropertyPacketTableInfo
Gets or sets an AudioFilePacketTableInfo struct for CAF files. When setting, the sum of mNumberValidFrames, mPrimingFrames and mRemainderFrames must be the same as the total number of frames in all packets. If not you will get a paramErr. The best way to ensure this is to 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.
Discussion

File Properties


Audio


constants for AudioFileGetGlobalInfo properties

enum { 
    kAudioFileGlobalInfo_ReadableTypes = 'afrf', 
    kAudioFileGlobalInfo_WritableTypes = 'afwf', 
    kAudioFileGlobalInfo_FileTypeName = 'ftnm', 
    kAudioFileGlobalInfo_ExtensionsForType = 'fext', 
    kAudioFileGlobalInfo_AllExtensions = 'alxt', 
    kAudioFileGlobalInfo_AvailableFormatIDs = 'fmid', 
    kAudioFileGlobalInfo_AvailableStreamDescriptionsForFormat = 'sdid', 
    kAudioFileGlobalInfo_HFSTypeCodesForType = 'fhfs', 
    kAudioFileGlobalInfo_AllHFSTypeCodes = 'ahfs' 
}; 
Constants
kAudioFileGlobalInfo_ReadableTypes
No specifier needed. Must be set to NULL. Returns an array of UInt32 containing the file types (i.e. AIFF, WAVE, etc) that can be opened for reading.
kAudioFileGlobalInfo_WritableTypes
No specifier needed. Must be set to NULL. Returns an array of UInt32 containing the file types (i.e. AIFF, WAVE, etc) that can be opened for writing.
kAudioFileGlobalInfo_FileTypeName
Specifier is a pointer to a AudioFileTypeID containing a file type. Returns a CFString containing the name for the file type.
kAudioFileGlobalInfo_ExtensionsForType
Specifier is a pointer to a AudioFileTypeID containing a file type. Returns a CFArray of CFStrings containing the file extensions that are recognized for this file type.
kAudioFileGlobalInfo_AllExtensions
No specifier needed. Must be set to NULL. Returns a CFArray of CFStrings containing all file extensions that are recognized. The array be used when creating an NSOpenPanel.
kAudioFileGlobalInfo_AvailableFormatIDs
Specifier is a pointer to a AudioFileTypeID containing a file type. Returns a array of format IDs for formats that can be read.
kAudioFileGlobalInfo_AvailableStreamDescriptionsForFormat
Specifier is a pointer to a AudioFileTypeAndFormatID struct defined below. Returns an array of AudioStreamBasicDescriptions which have all of the formats for a particular file type and format ID. The AudioStreamBasicDescriptions have the following fields filled in: mFormatID, mFormatFlags, mBitsPerChannel
kAudioFileGlobalInfo_HFSTypeCodesForType
Specifier is a pointer to an AudioFileTypeID. Returns an array of HFSTypeCodes corresponding to that file type. The first type in the array is the preferred one for use when writing new files.
kAudioFileGlobalInfo_AllHFSTypeCodes
No specifier needed. Must be set to NULL. Returns an array of HFSTypeCode's containing all HFSTypeCodes that are recognized.

Discussion

File Global Info Properties

(Last Updated July 18, 2005)