Share via


AudioFile.OpenRead Method

Definition

Overloads

Name Description
OpenRead(CFUrl, AudioFileType)

Opens an audio file for reading.

OpenRead(NSUrl, AudioFileType)

Opens an audio file for reading.

OpenRead(String, AudioFileType)

Opens an audio file for reading.

OpenRead(CFUrl, AudioFileError, AudioFileType)

Opens an audio file for reading.

OpenRead(NSUrl, AudioFileError, AudioFileType)

Opens an audio file for reading.

OpenRead(String, AudioFileError, AudioFileType)

Opens an audio file for reading.

OpenRead(CFUrl, AudioFileType)

Opens an audio file for reading.

public static AudioToolbox.AudioFile? OpenRead(CoreFoundation.CFUrl url, AudioToolbox.AudioFileType fileTypeHint =(AudioToolbox.AudioFileType) 0);
static member OpenRead : CoreFoundation.CFUrl * AudioToolbox.AudioFileType -> AudioToolbox.AudioFile

Parameters

url
CFUrl

A url to a local file name.

fileTypeHint
AudioFileType

A hint indicating the file format expected, this is necessary for audio files where the operating system can not probe the type by looking at the file signature or file extension (for example AC3). Pass zero to auto detect the format.

Returns

An instance of AudioFile on success, or null on error.

Applies to

OpenRead(NSUrl, AudioFileType)

Opens an audio file for reading.

public static AudioToolbox.AudioFile? OpenRead(Foundation.NSUrl url, AudioToolbox.AudioFileType fileTypeHint =(AudioToolbox.AudioFileType) 0);
static member OpenRead : Foundation.NSUrl * AudioToolbox.AudioFileType -> AudioToolbox.AudioFile

Parameters

url
NSUrl

A url to a local file name.

fileTypeHint
AudioFileType

A hint indicating the file format expected, this is necessary for audio files where the operating system can not probe the type by looking at the file signature or file extension (for example AC3). Pass zero to auto detect the format.

Returns

An instance of AudioFile on success, or null on error.

Applies to

OpenRead(String, AudioFileType)

Opens an audio file for reading.

public static AudioToolbox.AudioFile? OpenRead(string url, AudioToolbox.AudioFileType fileTypeHint =(AudioToolbox.AudioFileType) 0);
static member OpenRead : string * AudioToolbox.AudioFileType -> AudioToolbox.AudioFile

Parameters

url
String

A url to a local file name.

fileTypeHint
AudioFileType

A hint indicating the file format expected, this is necessary for audio files where the operating system can not probe the type by looking at the file signature or file extension (for example AC3). Pass zero to auto detect the format.

Returns

An instance of AudioFile on success, or null on error.

Remarks

The hint is necessary as sometimes it is not possible to determine the file type merely based on the contents of the file.

Once you have opened the file for reading, you can use the various Read methods to decode the audio packets contained in the file.

Applies to

OpenRead(CFUrl, AudioFileError, AudioFileType)

Opens an audio file for reading.

public static AudioToolbox.AudioFile? OpenRead(CoreFoundation.CFUrl url, out AudioToolbox.AudioFileError error, AudioToolbox.AudioFileType fileTypeHint =(AudioToolbox.AudioFileType) 0);
static member OpenRead : CoreFoundation.CFUrl * AudioFileError * AudioToolbox.AudioFileType -> AudioToolbox.AudioFile

Parameters

url
CFUrl

A url to a local file name.

error
AudioFileError

Success if successful, or an error code otherwise.

fileTypeHint
AudioFileType

A hint indicating the file format expected, this is necessary for audio files where the operating system can not probe the type by looking at the file signature or file extension (for example AC3). Pass zero to auto detect the format.

Returns

An instance of AudioFile on success, or null on error.

Applies to

OpenRead(NSUrl, AudioFileError, AudioFileType)

Opens an audio file for reading.

public static AudioToolbox.AudioFile? OpenRead(Foundation.NSUrl url, out AudioToolbox.AudioFileError error, AudioToolbox.AudioFileType fileTypeHint =(AudioToolbox.AudioFileType) 0);
static member OpenRead : Foundation.NSUrl * AudioFileError * AudioToolbox.AudioFileType -> AudioToolbox.AudioFile

Parameters

url
NSUrl

A url to a local file name.

error
AudioFileError

Success if successful, or an error code otherwise.

fileTypeHint
AudioFileType

A hint indicating the file format expected, this is necessary for audio files where the operating system can not probe the type by looking at the file signature or file extension (for example AC3). Pass zero to auto detect the format.

Returns

An instance of AudioFile on success, or null on error.

Applies to

OpenRead(String, AudioFileError, AudioFileType)

Opens an audio file for reading.

public static AudioToolbox.AudioFile? OpenRead(string url, out AudioToolbox.AudioFileError error, AudioToolbox.AudioFileType fileTypeHint =(AudioToolbox.AudioFileType) 0);
static member OpenRead : string * AudioFileError * AudioToolbox.AudioFileType -> AudioToolbox.AudioFile

Parameters

url
String

A url to a local file name.

error
AudioFileError

Success if successful, or an error code otherwise.

fileTypeHint
AudioFileType

A hint indicating the file format expected, this is necessary for audio files where the operating system can not probe the type by looking at the file signature or file extension (for example AC3). Pass zero to auto detect the format.

Returns

An instance of AudioFile on success, or null on error.

Remarks

The hint is necessary as sometimes it is not possible to determine the file type merely based on the contents of the file.

Once you have opened the file for reading, you can use the various Read methods to decode the audio packets contained in the file.

Applies to