Edit

Share via


AudioFile Class

Definition

Class used to create audio files or read audio files.

public class AudioFile : IDisposable, ObjCRuntime.INativeObject
type AudioFile = class
    interface IDisposable
    interface INativeObject
Inheritance
AudioFile
Derived
Implements

Remarks

Use the Create, Open and OpenRead factory methods to create instances of this class.

This class provides access to the encoder and decoder for compressed audio files.

Constructors

AudioFile(Boolean)

This is an internal constructor, do not use directly.

Properties

AlbumArtwork

Gets the album artwork for the audio file.

AudioFormats

Returns a list of the supported audio formats.

BitRate

Audio file bit rate.

ChannelLayout

Gets the channel layout of the audio file.

ChunkIDs

Gets an array of four-character codes that describe the kind of each chunk in the audio file.

DataFormat

Gets the AudioStreamBasicDescription, if present, that describes the format of the audio data.

DataOffset

Gets the offset, in bytes, to the beginning of the audio data in the audio file.

DataPacketCount

Gets the number of audio data packets in the audio file.

DeferSizeUpdates

Gets or sets a Boolean value that controls whether the updating of file size information in the header will be deferred until the file is read, optimized, or closed. The default, which is safer, is false

EstimatedDuration

Gets the estimated duration, in seconds, of the audio data in the file.

FileType

Audio file type.

Handle

Handle (pointer) to the unmanaged object representation.

ID3Tag

Gets a byte array that contains the ID3Tag for the audio data.

InfoDictionary

Gets the CF dictionary that contains audio file metadata.

IsOptimized

Gets a Boolean value that tells whether the audio file has been optimized and is ready to receive sound data.

Length

Audio file size, in bytes.

MagicCookie

The magic cookie for this file.

MarkerList

Gets the AudioFileMarkerList that contains the markers for the audio file.

MaximumPacketSize

Gets the maximum audio packet size.

PacketSizeUpperBound

Gets the theoretical upper bound for the audio packet size for audio data in the file.

PacketTableInfo

Gets or sets the AudioFilePacketTableInfo structure that describes the audio file packet table.

PacketTableInfoStatus

Gets the status of the audio packet table..

RegionList

Gets a list of all the audio regions in the audio file.

ReserveDuration

Gets the amount of recording time to reserve in the audio file.

StreamBasicDescription

The audio basic description, as determined by decoding the file.

StreamBasicDescriptionStatus

Gets the status of the stream's basic description.

Methods

ByteToPacket(Int64, Int32, Boolean)

Converts a position on a stream to its packet location.

CountUserData(UInt32)

Returns the number of user data items that have the specified userData.

Create(CFUrl, AudioFileType, AudioStreamBasicDescription, AudioFileFlags)

Creates a new audio file.

Create(NSUrl, AudioFileType, AudioStreamBasicDescription, AudioFileFlags)

Creates a new audio file.

Create(String, AudioFileType, AudioStreamBasicDescription, AudioFileFlags)

Creates a new audio file.

Dispose()

Releases the resources used by the AudioFile object.

Dispose(Boolean)

Releases the resources used by the AudioFile object.

Finalize()

Finalizer for the AudioFile object

FrameToPacket(Int64, Int32)

Converts an audio frame into a packet offset.

GetProperty(AudioFileProperty, Int32)

Returns the value of the specified audio property, and stores the number of bytes allocated to store it in size.

GetProperty(AudioFileProperty, Int32, IntPtr)

Returns the value of the specified audio property, stores it in outData, and stores the number of bytes allocated to store it in dataSize.

GetPropertyInfo(AudioFileProperty, Int32, Int32)

Returns the value of the specified audio property, and stores the number of bytes allocated to store it in size, and indicates whether the value is writeable.

GetUserData(Int32, Int32, Int32, IntPtr)

Gets the indexth chunk of user data that has the specified userDataID.

GetUserDataSize(UInt32, Int32)

Gets the size of the indexth chunk of user data that has the specified userDataID.

IsPropertyWritable(AudioFileProperty)

Checks whether the property value is settable.

Open(CFUrl, AudioFilePermission, AudioFileError, AudioFileType)

Opens an audio file.

Open(CFUrl, AudioFilePermission, AudioFileType)

Opens an audio file.

Open(NSUrl, AudioFilePermission, AudioFileError, AudioFileType)

Opens an audio file.

Open(NSUrl, AudioFilePermission, AudioFileType)

Opens an audio file.

Open(String, AudioFilePermission, AudioFileError, AudioFileType)

Opens an audio file.

Open(String, AudioFilePermission, AudioFileType)

Opens an audio file.

OpenRead(CFUrl, AudioFileError, AudioFileType)

Opens an audio file for reading.

OpenRead(CFUrl, AudioFileType)

Opens the specified audio file for reading, frames will be decoded from the native format to raw audio data.

OpenRead(NSUrl, AudioFileError, AudioFileType)

Opens an audio file for reading.

OpenRead(NSUrl, AudioFileType)

Opens the specified audio file for reading, frames will be decoded from the native format to raw audio data.

OpenRead(String, AudioFileError, AudioFileType)

Opens an audio file for reading.

OpenRead(String, AudioFileType)

Opens an audio file for reading.

Optimize()

Optimizes the audio file, thus preparing it to receive audio data.

PacketToByte(Int64, Boolean)

Returns the byte offset for the packet and indicates whether this is an estimated value in isEstimate.

PacketToFrame(Int64)

Returns the frame number for the specified packet.

Read(Int64, Byte[], Int32, Int32, Boolean)

Reads count bytes from buffer, starting at startingByte.

ReadFixedPackets(Boolean, Int64, Int32, Byte[], Int32, Int32)

Reads a fixed amount of audio data.

ReadFixedPackets(Boolean, Int64, Int32, Byte[], Int32, Int32, AudioFileError)

Reads a fixed amount of audio data.

ReadFixedPackets(Int64, Int32, Byte[])

Reads nPackets bytes into buffer, starting at inStartingPacket.

ReadFixedPackets(Int64, Int32, Byte[], AudioFileError)

Reads a fixed amount of audio data.

ReadPacketData(Boolean, Int64, Int32, Byte[], Int32, Int32)

Reads packets of audio data from an audio file.

ReadPacketData(Boolean, Int64, Int32, Byte[], Int32, Int32)

Reads packets of audio data from an audio file.

ReadPacketData(Boolean, Int64, Int32, Byte[], Int32, Int32, AudioFileError)

Reads packets of audio data.

ReadPacketData(Boolean, Int64, Int32, Byte[], Int32, Int32, AudioFileError)

Reads packets of audio data.

ReadPacketData(Boolean, Int64, Int32, IntPtr, Int32)

Reads packets of audio data from an audio file.

ReadPacketData(Boolean, Int64, Int32, IntPtr, Int32, AudioFileError)

Reads packets of audio data.

ReadPacketData(Boolean, Int64, Int32, IntPtr, Int32, AudioFileError, AudioStreamPacketDescription[])

Reads packets of audio data.

ReadPacketData(Int64, Int32, Byte[])

Reads packets of audio data from an audio file.

ReadPacketData(Int64, Int32, Byte[], AudioFileError)

Reads packets of audio data.

RemoveUserData(Int32, Int32)

Removes the chunk of user data at the specified index in the user data that is identified by userDataID.

SetProperty(AudioFileProperty, Int32, IntPtr)

Sets the value of the specified property to propertyData, which must have the size that is specified in dataSize.

SetUserData(Int32, Int32, Int32, IntPtr)

Sets the value at the specified index into the specified property to propertyData, which must have the size that is specified in dataSize.

Write(Int64, Byte[], Int32, Int32, Boolean)

Writes a block of data to the audio file.

Write(Int64, Byte[], Int32, Int32, Boolean, Int32)

Writes data to an audo file.

WritePackets(Boolean, Int32, AudioStreamPacketDescription[], Int64, Int32, IntPtr)

Writes audio packets to the file.

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], Byte[], Int32, Int32)

Writes audio packets to the file.

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], Byte[], Int32, Int32, Int32)

Writes packets to an audo file.

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], IntPtr, Int32)

Write audio packets to the audio file.

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], IntPtr, Int32, Int32)

Writes packets to an audo file.

WritePackets(Boolean, Int64, Int32, IntPtr, Int32)

Writes packets to an audo file.

Applies to