Open an existing audio file specified by a URL.
SDKs
- iOS 2.0+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- Audio
Toolbox
Declaration
OSStatus AudioFileOpenURL(CFURLRef inFileRef, Audio File Permissions inPermissions, Audio File Type ID inFileTypeHint, Audio File ID _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
Audio
.File Permissions 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.