Function

AudioFileInitializeWithCallbacks

Deletes the content of an existing file and assigns callbacks to the audio file object.

Declaration

OSStatus AudioFileInitializeWithCallbacks(void *inClientData, AudioFile_ReadProc inReadFunc, AudioFile_WriteProc inWriteFunc, AudioFile_GetSizeProc inGetSizeFunc, AudioFile_SetSizeProc inSetSizeFunc, AudioFileTypeID inFileType, const AudioStreamBasicDescription *inFormat, AudioFileFlags inFlags, AudioFileID  _Nullable *outAudioFile);

Parameters

inClientData

A pointer to a constant passed to your callbacks. Th constant should contain any information you use to manage the state for reading data from the file.

inReadFunc

A callback function invoked when the audio file object wants to read data.

inWriteFunc

A callback function invoked when the audio file object wants to write data.

inGetSizeFunc

A callback function invoked when the audio file object wants to know the size of the file.

inSetSizeFunc

A callback function invoked when the audio file object wants to set the size of the file.

inFileType

The type of audio file to initialize

inFormat

The format for the audio data in the file.

inFlags

Flags for creating or opening the file. Set to 0.

outAudioFile

On output, a pointer to the newly initialized audio file.

Return Value

A result code. See Result Codes.

See Also

Creating and Initializing Audio Files

AudioFileCreateWithURL

Creates a new audio file, or initializes an existing file, specified by a URL.