lightbulb_outline Help shape the future of the Google Play Console, Android Studio, and Firebase. Start survey

AudioPresentation

public final class AudioPresentation
extends Object

java.lang.Object
   ↳ android.media.AudioPresentation


The AudioPresentation class encapsulates the information that describes an audio presentation which is available in next generation audio content. Used by MediaExtractor MediaExtractor.getAudioPresentations(int) and AudioTrack AudioTrack.setPresentation(AudioPresentation) to query available presentations and to select one. A list of available audio presentations in a media source can be queried using MediaExtractor.getAudioPresentations(int). This list can be presented to a user for selection. An AudioPresentation can be passed to an offloaded audio decoder via AudioTrack.setPresentation(AudioPresentation) to request decoding of the selected presentation. An audio stream may contain multiple presentations that differ by language, accessibility, end point mastering and dialogue enhancement. An audio presentation may also have a set of description labels in different languages to help the user to make an informed selection.

Summary

Constants

int MASTERED_FOR_3D

Three-dimensional (e.g.

int MASTERED_FOR_HEADPHONE

Prerendered for headphone playback.

int MASTERED_FOR_STEREO

Stereo speaker layout.

int MASTERED_FOR_SURROUND

Two-dimensional (e.g.

int MASTERING_NOT_INDICATED

No preferred reproduction channel layout.

Public methods

Map<LocaleString> getLabels()
Locale getLocale()
int getMasteringIndication()
boolean hasAudioDescription()

Indicates whether an audio description for the visually impaired is available.

boolean hasDialogueEnhancement()

Indicates whether dialogue enhancement is available.

boolean hasSpokenSubtitles()

Indicates whether spoken subtitles for the visually impaired are available.

Inherited methods

Constants

MASTERED_FOR_3D

added in API level 28
public static final int MASTERED_FOR_3D

Three-dimensional (e.g. 5.1.2) speaker layout.

Constant Value: 3 (0x00000003)

MASTERED_FOR_HEADPHONE

added in API level 28
public static final int MASTERED_FOR_HEADPHONE

Prerendered for headphone playback.

Constant Value: 4 (0x00000004)

MASTERED_FOR_STEREO

added in API level 28
public static final int MASTERED_FOR_STEREO

Stereo speaker layout.

Constant Value: 1 (0x00000001)

MASTERED_FOR_SURROUND

added in API level 28
public static final int MASTERED_FOR_SURROUND

Two-dimensional (e.g. 5.1) speaker layout.

Constant Value: 2 (0x00000002)

MASTERING_NOT_INDICATED

added in API level 28
public static final int MASTERING_NOT_INDICATED

No preferred reproduction channel layout.

Constant Value: 0 (0x00000000)

Public methods

getLabels

added in API level 28
public Map<LocaleString> getLabels ()

Returns
Map<LocaleString> a map of available text labels for this presentation. Each label is indexed by its locale corresponding to the language code as specified by ISO 639-2. Either ISO 639-2/B or ISO 639-2/T could be used.

getLocale

added in API level 28
public Locale getLocale ()

Returns
Locale the locale corresponding to audio presentation's ISO 639-1/639-2 language code.

getMasteringIndication

added in API level 28
public int getMasteringIndication ()

Returns
int the mastering indication of the audio presentation. See MASTERING_NOT_INDICATED, MASTERED_FOR_STEREO, MASTERED_FOR_SURROUND, MASTERED_FOR_3D, MASTERED_FOR_HEADPHONE

hasAudioDescription

added in API level 28
public boolean hasAudioDescription ()

Indicates whether an audio description for the visually impaired is available.

Returns
boolean true if audio description is available.

hasDialogueEnhancement

added in API level 28
public boolean hasDialogueEnhancement ()

Indicates whether dialogue enhancement is available.

Returns
boolean true if dialogue enhancement is available.

hasSpokenSubtitles

added in API level 28
public boolean hasSpokenSubtitles ()

Indicates whether spoken subtitles for the visually impaired are available.

Returns
boolean true if spoken subtitles are available.