iOS Guides | Samples

MonoTouch.AudioToolbox.AudioFileStream Class

Process partial audio files.

See Also: AudioFileStream

Syntax

public class AudioFileStream : IDisposable

Remarks

You use AudioFileStream when you want to decode audio content that does not live in an local file or if you want to decode it in chunks. New data is fed into the AudioFileStream using one of the ParseBytes method and decoded audio is provided on the PacketDecoded event (or the OnPacketDecoded virtual method) and information about the stream is raised on the PropertyFound event (or the OnPropertyFound virtual method).

This can be used to parse audio files when you are streaming audio from the network for example.

The methods and properties in this class update the AudioFileStream.LastError property to track any potential errors during parsing, but without throwing an exception.

Related content

Requirements

Namespace: MonoTouch.AudioToolbox
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0

The members of MonoTouch.AudioToolbox.AudioFileStream are listed below.

See Also: Object

Public Constructors

Creates a new instance of this object.

Public Fields

PacketDecodedEventHandler<PacketReceivedEventArgs>. This event is raised when a packet has been decoded.
PropertyFoundEventHandler<PropertyFoundEventArgs>. This event is raised when a property has been found on the decoded data.

Public Properties

[read-only]
AverageBytesPerPacketDouble. Average bytes per packet. This value is precise for audio files with constant bit rates or audio files that have a packet index, otherwise it is a computed average.
[read-only]
BitRateInt32. The stream's bit rate in bits per second.
[read-only]
ChannelLayoutAudioChannelLayout. The channel layout for the audio stream.
[read-only]
DataByteCountInt64. For streams whose length is known, the number of audio byte data.
[read-only]
DataFormatAudioStreamBasicDescription. Format of the data (as an AudioStreamBasicDescription
[read-only]
DataOffsetInt64. Offset of the audio date from the beginning of the audio file stream.
[read-only]
DataPacketCountInt64. The number of audio packets on the audio file stream.
[read-only]
FileTypeAudioFileType. The audio file type for the audio stream.
[read-only]
FormatListAudioFormat[]. List of formats supported by the audio stream.
[read-only]
LastErrorAudioFileStreamStatus. Contains the latest error code set by one of the methods in AudioFileStream.
[read-only]
MagicCookieByte[]. The magic cookie for this file.
[read-only]
MaximumPacketSizeInt32. Maximum packet size for data on the audio file stream
[read-only]
PacketSizeUpperBoundInt32. The largest possible packet size.
[read-only]
PacketTableInfoNullable<AudioFilePacketTableInfo>. Contains information about the valid frames in the audio file stream (their start and end).
[read-only]
ReadyToProducePacketsBoolean. Set to true once the file stream parser has read enough of the headers to be able to produce audio packets.
[read-only]
StreamBasicDescriptionAudioStreamBasicDescription. Format of the data

Public Methods

ByteToPacket(Int64, out Int32, out Boolean) : Int64
Maps a position in the file to an audio packet.
Close()
Closes (and disposes the audio stream).
Dispose()
Releases the resources used by the AudioFileStream object.
Finalize()
Finalizer for the AudioFileStream object
FrameToPacket(Int64, out Int32) : Int64
Returns the packet number and the frame offset in the packet (on the out parameter) corresponding to the requested audio frame.
GetProperty(AudioFileStreamProperty, out Int32) : IntPtr
Low-level routine used to fetch arbitrary property values from the underlying AudioFileStream object.
GetProperty(AudioFileStreamProperty, ref Int32, IntPtr) : Boolean
Low-level routine used to fetch arbitrary property values from the underlying AudioFileStream object.
PacketToByte(Int64, out Boolean) : Int64
Maps a packet number to a byte number in the audio file stream.
PacketToFrame(Int64) : Int64
Maps a packet number to an audio frame number in the audio file stream.
ParseBytes(Byte[], Boolean) : AudioFileStreamStatus
Parse and decode the array of bytes provided.
ParseBytes(Int32, IntPtr, Boolean) : AudioFileStreamStatus
Parse and decode the block of data provided.
ParseBytes(Byte[], Int32, Int32, Boolean) : AudioFileStreamStatus
Parses and decode a portion of the array of bytes provided.
Seek(Int64, out Int64, out Boolean) : AudioFileStreamStatus
Maps the absolute file offset for the specified packetOffset.
SetProperty(AudioFileStreamProperty, Int32, IntPtr) : Boolean
Low-level property setting API. Use the exposed managed properties instead.

Protected Methods

Dispose(Boolean)
Releases the resources used by the AudioFileStream object.
OnPacketDecoded(Int32, IntPtr, AudioStreamPacketDescription[])
Invoked when a packet has been decoded.
OnPropertyFound(AudioFileStreamProperty, ref AudioFileStreamPropertyFlag)
Invoked when a propety is found.