Function

AudioFileOpenURL

Open an existing audio file specified by a URL.

Declaration

OSStatus AudioFileOpenURL(CFURLRef inFileRef, AudioFilePermissions inPermissions, AudioFileTypeID inFileTypeHint, AudioFileID  _Nullable *outAudioFile);

Parameters

inFileRef

The URL of an existing audio file.

inPermissions

The read-write permissions you want to assign to the file. Use the permission constants in AudioFilePermissions.

inFileTypeHint

A hint for the file type of the designated file. For files without filename extensions and with types not easily or uniquely determined from the data (such as ADTS or AC3), use this hint to indicate the file type. Otherwise, pass 0. Only use this hint in macOS versions 10.3.1 or greater. In all earlier versions, any attempt to open these files fails.

outAudioFile

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

Return Value

A result code. See Result Codes.

See Also

Opening and Closing Audio Files

AudioFileOpenWithCallbacks

Opens an existing file with callbacks you provide.

AudioFileClose

Closes an audio file.