Function

AudioFileOpenWithCallbacks

Opens an existing file with callbacks you provide.

Declaration

OSStatus AudioFileOpenWithCallbacks(void *inClientData, AudioFile_ReadProc inReadFunc, AudioFile_WriteProc inWriteFunc, AudioFile_GetSizeProc inGetSizeFunc, AudioFile_SetSizeProc inSetSizeFunc, AudioFileTypeID inFileTypeHint, AudioFileID  _Nullable *outAudioFile);

Parameters

inClientData

A pointer to a constant passed to your callbacks. The 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 called when the audio file object wants to write data.

inGetSizeFunc

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

inSetSizeFunc

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

inFileTypeHint

A hint about the type of the designated file. For files with no filename extension and without a type easily or uniquely determined from the data (ADTS,AC3), use this hint to indicate the file type. Otherwise, pass 0 for this parameter. The hint is only available in macOS versions 10.3.1 or greater. In versions prior to OS X 10.3.1, opening files such files fails.

outAudioFile

On output, a pointer to the newly opened file.

Return Value

A result code. See Result Codes.

See Also

Opening and Closing Audio Files

AudioFileOpenURL

Open an existing audio file specified by a URL.

AudioFileClose

Closes an audio file.