Added in API level 31

AudioProfile


open class AudioProfile : Parcelable

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
static Int

Encapsulation format is defined in standard IEC 61937.

static Int

No encapsulation type is specified.

static Int

Encapsulation format is PCM, which can be used by other formats that can be wrapped in a PCM frame, such as DSD(Direct Stream Digital).

Inherited constants
Int CONTENTS_FILE_DESCRIPTOR

Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor.

Int PARCELABLE_WRITE_RETURN_VALUE

Flag for use with writeToParcel: the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)". Some implementations may want to release resources at this point.

Public methods
open Int

open Boolean
equals(other: Any?)

open IntArray

open IntArray

open Int

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.

open Int

open IntArray

open Int

open String

open Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Constants

AUDIO_ENCAPSULATION_TYPE_IEC61937

Added in API level 31
static val AUDIO_ENCAPSULATION_TYPE_IEC61937: Int

Encapsulation format is defined in standard IEC 61937.

Value: 1

AUDIO_ENCAPSULATION_TYPE_NONE

Added in API level 31
static val AUDIO_ENCAPSULATION_TYPE_NONE: Int

No encapsulation type is specified.

Value: 0

AUDIO_ENCAPSULATION_TYPE_PCM

Added in API level 34
static val AUDIO_ENCAPSULATION_TYPE_PCM: Int

Encapsulation format is PCM, which can be used by other formats that can be wrapped in a PCM frame, such as DSD(Direct Stream Digital).

Value: 2

Public methods

describeContents

Added in API level 33
open fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 31
open fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getChannelIndexMasks

Added in API level 31
open fun getChannelIndexMasks(): IntArray
Return
IntArray an array of channel index masks that are associated with the encoding format. This value cannot be null.

getChannelMasks

Added in API level 31
open fun getChannelMasks(): IntArray
Return
IntArray an array of channel position masks that are associated with the encoding format. This value cannot be null.

getEncapsulationType

Added in API level 31
open fun getEncapsulationType(): Int

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 android.media.AudioTrack API is supported. But playback with android.media.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.

getFormat

Added in API level 31
open fun getFormat(): Int
Return
Int the encoding format for this AudioProfile. Value is android.media.AudioFormat#ENCODING_DEFAULT, android.media.AudioFormat#ENCODING_PCM_16BIT, android.media.AudioFormat#ENCODING_PCM_8BIT, android.media.AudioFormat#ENCODING_PCM_FLOAT, android.media.AudioFormat#ENCODING_AC3, android.media.AudioFormat#ENCODING_E_AC3, android.media.AudioFormat#ENCODING_DTS, android.media.AudioFormat#ENCODING_DTS_HD, android.media.AudioFormat#ENCODING_MP3, android.media.AudioFormat#ENCODING_AAC_LC, android.media.AudioFormat#ENCODING_AAC_HE_V1, android.media.AudioFormat#ENCODING_AAC_HE_V2, android.media.AudioFormat#ENCODING_IEC61937, android.media.AudioFormat#ENCODING_DOLBY_TRUEHD, android.media.AudioFormat#ENCODING_AAC_ELD, android.media.AudioFormat#ENCODING_AAC_XHE, android.media.AudioFormat#ENCODING_AC4, android.media.AudioFormat.ENCODING_AC4_L4, android.media.AudioFormat#ENCODING_E_AC3_JOC, android.media.AudioFormat#ENCODING_DOLBY_MAT, android.media.AudioFormat#ENCODING_OPUS, android.media.AudioFormat#ENCODING_PCM_24BIT_PACKED, android.media.AudioFormat#ENCODING_PCM_32BIT, android.media.AudioFormat#ENCODING_MPEGH_BL_L3, android.media.AudioFormat#ENCODING_MPEGH_BL_L4, android.media.AudioFormat#ENCODING_MPEGH_LC_L3, android.media.AudioFormat#ENCODING_MPEGH_LC_L4, android.media.AudioFormat#ENCODING_DTS_UHD_P1, android.media.AudioFormat#ENCODING_DRA, android.media.AudioFormat#ENCODING_DTS_HD_MA, android.media.AudioFormat#ENCODING_DTS_UHD_P2, android.media.AudioFormat#ENCODING_DSD, android.media.AudioFormat#ENCODING_IAMF_BASE_ENHANCED_PROFILE_AAC, android.media.AudioFormat#ENCODING_IAMF_BASE_ENHANCED_PROFILE_FLAC, android.media.AudioFormat#ENCODING_IAMF_BASE_ENHANCED_PROFILE_OPUS, android.media.AudioFormat#ENCODING_IAMF_BASE_ENHANCED_PROFILE_PCM, android.media.AudioFormat#ENCODING_IAMF_BASE_PROFILE_AAC, android.media.AudioFormat#ENCODING_IAMF_BASE_PROFILE_FLAC, android.media.AudioFormat#ENCODING_IAMF_BASE_PROFILE_OPUS, android.media.AudioFormat#ENCODING_IAMF_BASE_PROFILE_PCM, android.media.AudioFormat#ENCODING_IAMF_SIMPLE_PROFILE_AAC, android.media.AudioFormat#ENCODING_IAMF_SIMPLE_PROFILE_FLAC, android.media.AudioFormat#ENCODING_IAMF_SIMPLE_PROFILE_OPUS, or android.media.AudioFormat#ENCODING_IAMF_SIMPLE_PROFILE_PCM

getSampleRates

Added in API level 31
open fun getSampleRates(): IntArray
Return
IntArray an array of sample rates that are associated with the encoding format. This value cannot be null.

hashCode

Added in API level 31
open fun hashCode(): Int
Return
Int a hash code value for this object.

toString

Added in API level 31
open fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 33
open fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 33
static val CREATOR: Parcelable.Creator<AudioProfile!>