Class AudioMediaFormat

Definition

Namespace:
Tizen.Multimedia
Assembly:
Tizen.Multimedia.dll
API Level:
3

Represents an audio media format. This class cannot be inherited.

C#
Copy
public sealed class AudioMediaFormat : MediaFormat
Inheritance
System.Object
AudioMediaFormat

Constructors

View Source

AudioMediaFormat(MediaFormatAudioMimeType, Int32, Int32, Int32, Int32)

Initializes a new instance of the AudioMediaFormat class with the specified mime type, channel, sample rate, bit, and bit rate.

Declaration
C#
Copy
public AudioMediaFormat(MediaFormatAudioMimeType mimeType, int channel, int sampleRate, int bit, int bitRate)
Parameters
Type Name Description
MediaFormatAudioMimeType mimeType

The mime type of the format.

Int32 channel

The channel value of the format.

Int32 sampleRate

The sample rate value of the format.

Int32 bit

The bit value of the format.

Int32 bitRate

The bit rate value of the format.

Exceptions
Type Condition
System.ArgumentException

mimeType is invalid(i.e. undefined value).

System.ArgumentOutOfRangeException

channel, sampleRate, bit, or bitRate is less than zero.

API Level: 3
View Source

AudioMediaFormat(MediaFormatAudioMimeType, Int32, Int32, Int32, Int32, Int32, IList<MediaFormatAudioChannelPosition>)

Initializes a new instance of the AudioMediaFormat class with the specified mime type, channel, sample rate, bit, bit rate, bit depth, and audio channel map.

Declaration
C#
Copy
public AudioMediaFormat(MediaFormatAudioMimeType mimeType, int channel, int sampleRate, int bit, int bitRate, int bitDepth, IList<MediaFormatAudioChannelPosition> audioChannelMap)
Parameters
Type Name Description
MediaFormatAudioMimeType mimeType

The mime type of the format.

Int32 channel

The channel value of the format.

Int32 sampleRate

The sample rate value of the format.

Int32 bit

The bit value of the format.

Int32 bitRate

The bit rate value of the format.

Int32 bitDepth

The bit depth value of the PCM audio format.

System.Collections.Generic.IList<MediaFormatAudioChannelPosition> audioChannelMap

The loudspeaker position in PCM audio format.

Remarks

If audioChannelMap contains None, channel should be set greater than 0.
If audioChannelMap contains Mono, channel should be set 1.
User can not set None with another channel positions.
User can not set Mono with another channel positions.
If same channel position is added in audioChannelMap more than once, the duplicaiton will be removed.

Exceptions
Type Condition
System.ArgumentException

mimeType is invalid (i.e. undefined value).

System.ArgumentException

audioChannelMap is invalid or mismatched with channel like the following:
audioChannelMap is not matched correctly with channel. -or-
audioChannelMap is set to Invaild. -or-
Mono or None is set with another channel position.

System.ArgumentOutOfRangeException

channel, sampleRate, bit, or bitRate, bitDepth is less than zero.

API Level: 6
View Source

AudioMediaFormat(MediaFormatAudioMimeType, Int32, Int32, Int32, Int32, MediaFormatAacType)

Initializes a new instance of the AudioMediaFormat class with the specified mime type, channel, sample rate, bit, bit rate, and AAC type.

Declaration
C#
Copy
public AudioMediaFormat(MediaFormatAudioMimeType mimeType, int channel, int sampleRate, int bit, int bitRate, MediaFormatAacType aacType)
Parameters
Type Name Description
MediaFormatAudioMimeType mimeType

The mime type of the format.

Int32 channel

The channel value of the format.

Int32 sampleRate

The sample rate value of the format.

Int32 bit

The bit value of the format.

Int32 bitRate

The bit rate value of the format.

MediaFormatAacType aacType

The AAC bitstream format(ADIF or ADTS).

Exceptions
Type Condition
System.ArgumentException

mimeType or aacType is invalid (i.e. undefined value).
-or-
aacType is not None, but mimeType is one of the AAC types.

System.ArgumentOutOfRangeException

channel, sampleRate, bit, or bitRate is less than zero.

API Level: 3
View Source

AudioMediaFormat(MediaFormatAudioMimeType, Int32, Int32, Int32, Int32, MediaFormatAacType, Int32, IList<MediaFormatAudioChannelPosition>)

Initializes a new instance of the AudioMediaFormat class with the specified mime type, channel, sample rate, bit, bit rate, bit depth, and audio channel map.

Declaration
C#
Copy
public AudioMediaFormat(MediaFormatAudioMimeType mimeType, int channel, int sampleRate, int bit, int bitRate, MediaFormatAacType aacType, int bitDepth, IList<MediaFormatAudioChannelPosition> audioChannelMap)
Parameters
Type Name Description
MediaFormatAudioMimeType mimeType

The mime type of the format.

Int32 channel

The channel value of the format.

Int32 sampleRate

The sample rate value of the format.

Int32 bit

The bit value of the format.

Int32 bitRate

The bit rate value of the format.

MediaFormatAacType aacType

The AAC bitstream format(ADIF or ADTS).

Int32 bitDepth

The bit depth value of the PCM audio format.

System.Collections.Generic.IList<MediaFormatAudioChannelPosition> audioChannelMap

The loudspeaker position in PCM audio format.

Remarks

If audioChannelMap contains None, channel should be set greater than 0.
If audioChannelMap contains Mono, channel should be set 1.
User can not set None with another channel positions.
User can not set Mono with another channel positions.
If same channel position is added in audioChannelMap more than twice, its duplicaiton will be removed.

Exceptions
Type Condition
System.ArgumentException

mimeType or aacType is invalid (i.e. undefined value).
-or-
aacType is not None, but mimeType is one of the AAC types.

System.ArgumentException

audioChannelMap is invalid or mismatched with channel like the following:
audioChannelMap is not matched correctly with channel. -or-
audioChannelMap is set to Invaild. -or-
Mono or None is set with another channel position.

System.ArgumentOutOfRangeException

channel, sampleRate, bit, or bitRate, bitDepth is less than zero.

API Level: 6

Properties

View Source

AacType

Gets the AAC type of the current format.

Declaration
C#
Copy
public MediaFormatAacType AacType { get; }
Property Value
Type Description
MediaFormatAacType
API Level: 3
View Source

AudioChannelMap

Gets or sets the list of channel position value of PCM audio format.

Declaration
C#
Copy
public ReadOnlyCollection<MediaFormatAudioChannelPosition> AudioChannelMap { get; }
Property Value
Type Description
System.Collections.ObjectModel.ReadOnlyCollection<MediaFormatAudioChannelPosition>
Remarks

The channel mask specifies the mapping of channels to speakers. default value is 0.

API Level: 6
View Source

Bit

Gets the bit value of the current format.

Declaration
C#
Copy
public int Bit { get; }
Property Value
Type Description
Int32
API Level: 3
View Source

BitDepth

Gets the bit depth value of the current format.

Declaration
C#
Copy
public int BitDepth { get; }
Property Value
Type Description
Int32
API Level: 6
View Source

BitRate

Gets the bit rate value of the current format.

Declaration
C#
Copy
public int BitRate { get; }
Property Value
Type Description
Int32
API Level: 3
View Source

Channel

Gets the channel value of the current format.

Declaration
C#
Copy
public int Channel { get; }
Property Value
Type Description
Int32
API Level: 3
View Source

MimeType

Gets the mime type of the current format.

Declaration
C#
Copy
public MediaFormatAudioMimeType MimeType { get; }
Property Value
Type Description
MediaFormatAudioMimeType
API Level: 3
View Source

SampleRate

Gets the sample rate value of the current format.

Declaration
C#
Copy
public int SampleRate { get; }
Property Value
Type Description
Int32
API Level: 3

Methods

View Source

Equals(Object)

Compares an object to an instance of AudioMediaFormat for equality.

Declaration
C#
Copy
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

A System.Object to compare.

Returns
Type Description
Boolean

true if the formats are equal; otherwise, false.

Overrides
System.Object.Equals(System.Object)
API Level: 3
View Source

GetHashCode()

Gets the hash code for this instance of AudioMediaFormat.

Declaration
C#
Copy
public override int GetHashCode()
Returns
Type Description
Int32

The hash code for this instance of AudioMediaFormat.

Overrides
System.Object.GetHashCode()
API Level: 3
View Source

ToString()

Returns a string that represents the current object.

Declaration
C#
Copy
public override string ToString()
Returns
Type Description
System.String

A string that represents the current object.

Overrides
System.Object.ToString()
API Level: 3