# Print output for @column tags ?> AudioProfile - Android SDK | Android Developers

Most visited

Recently visited

AudioProfile

public class AudioProfile
extends Object

java.lang.Object
   ↳ android.media.AudioProfile


An AudioProfile is specific to an audio format and lists supported sampling rates and channel masks for that format. An AudioDeviceInfo has a list of supported AudioProfiles. There can be multiple profiles whose encoding format is the same. This usually happens when an encoding format is only supported when it is encapsulated by some particular encapsulation types. If there are multiple encapsulation types that can carry this encoding format, they will be reported in different audio profiles. The application can choose any of the encapsulation types.

Summary

Constants

int AUDIO_ENCAPSULATION_TYPE_IEC61937

Encapsulation format is defined in standard IEC 61937.

int AUDIO_ENCAPSULATION_TYPE_NONE

No encapsulation type is specified.

Public methods

int[] getChannelIndexMasks()
int[] getChannelMasks()
int getEncapsulationType()

The encapsulation type indicates what encapsulation type is required when the framework is using this format when playing to a device exposing this audio profile.

int getFormat()
int[] getSampleRates()
String toString()

Returns a string representation of the object.

Inherited methods

Constants

AUDIO_ENCAPSULATION_TYPE_IEC61937

public static final int AUDIO_ENCAPSULATION_TYPE_IEC61937

Encapsulation format is defined in standard IEC 61937.

Constant Value: 1 (0x00000001)

AUDIO_ENCAPSULATION_TYPE_NONE

public static final int AUDIO_ENCAPSULATION_TYPE_NONE

No encapsulation type is specified.

Constant Value: 0 (0x00000000)

Public methods

getChannelIndexMasks

public int[] getChannelIndexMasks ()

Returns
int[] an array of channel index masks that are associated with the encoding format. This value cannot be null.

getChannelMasks

public int[] getChannelMasks ()

Returns
int[] an array of channel position masks that are associated with the encoding format. This value cannot be null.

getEncapsulationType

public int getEncapsulationType ()

The encapsulation type indicates what encapsulation type is required when the framework is using this format when playing to a device exposing this audio profile. When encapsulation is required, only playback with AudioTrack API is supported. But playback with MediaPlayer is not. When an encapsulation type is required, the AudioFormat encoding selected when creating the AudioTrack must match the encapsulation type, e.g AudioFormat.ENCODING_IEC61937 for AUDIO_ENCAPSULATION_TYPE_IEC61937.

Returns
int an integer representing the encapsulation type Value is AUDIO_ENCAPSULATION_TYPE_NONE, or AUDIO_ENCAPSULATION_TYPE_IEC61937

See also:

getFormat

public int getFormat ()

Returns
int the encoding format for this AudioProfile. Value is AudioFormat.ENCODING_DEFAULT, AudioFormat.ENCODING_PCM_16BIT, AudioFormat.ENCODING_PCM_8BIT, AudioFormat.ENCODING_PCM_FLOAT, AudioFormat.ENCODING_AC3, AudioFormat.ENCODING_E_AC3, AudioFormat.ENCODING_DTS, AudioFormat.ENCODING_DTS_HD, AudioFormat.ENCODING_MP3, AudioFormat.ENCODING_AAC_LC, AudioFormat.ENCODING_AAC_HE_V1, AudioFormat.ENCODING_AAC_HE_V2, AudioFormat.ENCODING_IEC61937, AudioFormat.ENCODING_DOLBY_TRUEHD, AudioFormat.ENCODING_AAC_ELD, AudioFormat.ENCODING_AAC_XHE, AudioFormat.ENCODING_AC4, AudioFormat.ENCODING_E_AC3_JOC, AudioFormat.ENCODING_DOLBY_MAT, AudioFormat.ENCODING_OPUS, AudioFormat.ENCODING_PCM_24BIT_PACKED, AudioFormat.ENCODING_PCM_32BIT, AudioFormat.ENCODING_MPEGH_BL_L3, AudioFormat.ENCODING_MPEGH_BL_L4, AudioFormat.ENCODING_MPEGH_LC_L3, AudioFormat.ENCODING_MPEGH_LC_L4, AudioFormat.ENCODING_DTS_UHD, or AudioFormat.ENCODING_DRA

getSampleRates

public int[] getSampleRates ()

Returns
int[] an array of sample rates that are associated with the encoding format. This value cannot be null.

toString

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String a string representation of the object.