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 getAudioPresentations(int) and 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 getAudioPresentations(int). This list can be presented to a user for selection. An AudioPresentation can be passed to an offloaded audio decoder via 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

int MASTERED_FOR_3D

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

Constant Value: 3 (0x00000003)

MASTERED_FOR_HEADPHONE

int MASTERED_FOR_HEADPHONE

Prerendered for headphone playback.

Constant Value: 4 (0x00000004)

MASTERED_FOR_STEREO

int MASTERED_FOR_STEREO

Stereo speaker layout.

Constant Value: 1 (0x00000001)

MASTERED_FOR_SURROUND

int MASTERED_FOR_SURROUND

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

Constant Value: 2 (0x00000002)

MASTERING_NOT_INDICATED

int MASTERING_NOT_INDICATED

No preferred reproduction channel layout.

Constant Value: 0 (0x00000000)

Public methods

getLabels

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

Locale getLocale ()

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

getMasteringIndication

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

boolean hasAudioDescription ()

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

Returns
boolean true if audio description is available.

hasDialogueEnhancement

boolean hasDialogueEnhancement ()

Indicates whether dialogue enhancement is available.

Returns
boolean true if dialogue enhancement is available.

hasSpokenSubtitles

boolean hasSpokenSubtitles ()

Indicates whether spoken subtitles for the visually impaired are available.

Returns
boolean true if spoken subtitles are available.