Class AudioAttributes
- java.lang.Object
-
- com.google.android.exoplayer2.audio.AudioAttributes
-
- All Implemented Interfaces:
Bundleable
@Deprecated public final class AudioAttributes extends Object implements Bundleable
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Attributes for audio playback, which configure the underlying platformAudioTrack
.To set the audio attributes, create an instance using the
AudioAttributes.Builder
and either pass it to the player or send a message of typeRenderer#MSG_SET_AUDIO_ATTRIBUTES
to the audio renderers.This class is based on
AudioAttributes
, but can be used on all supported API versions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AudioAttributes.AudioAttributesV21
Deprecated.A direct wrapper aroundAudioAttributes
.static class
AudioAttributes.Builder
Deprecated.Builder forAudioAttributes
.-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Field Summary
Fields Modifier and Type Field Description @com.google.android.exoplayer2.C.AudioAllowedCapturePolicy int
allowedCapturePolicy
Deprecated.@com.google.android.exoplayer2.C.AudioContentType int
contentType
Deprecated.TheC.AudioContentType
.static Bundleable.Creator<AudioAttributes>
CREATOR
Deprecated.Object that can restoreAudioAttributes
from aBundle
.static AudioAttributes
DEFAULT
Deprecated.The default audio attributes, where the content type isC.AUDIO_CONTENT_TYPE_UNKNOWN
, usage isC.USAGE_MEDIA
, capture policy isC.ALLOW_CAPTURE_BY_ALL
and no flags are set.@com.google.android.exoplayer2.C.AudioFlags int
flags
Deprecated.TheC.AudioFlags
.@com.google.android.exoplayer2.C.SpatializationBehavior int
spatializationBehavior
Deprecated.@com.google.android.exoplayer2.C.AudioUsage int
usage
Deprecated.TheC.AudioUsage
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object obj)
Deprecated.AudioAttributes.AudioAttributesV21
getAudioAttributesV21()
Deprecated.Returns aAudioAttributes.AudioAttributesV21
from this instance.int
hashCode()
Deprecated.Bundle
toBundle()
Deprecated.Returns aBundle
representing the information stored in this object.
-
-
-
Field Detail
-
DEFAULT
public static final AudioAttributes DEFAULT
Deprecated.The default audio attributes, where the content type isC.AUDIO_CONTENT_TYPE_UNKNOWN
, usage isC.USAGE_MEDIA
, capture policy isC.ALLOW_CAPTURE_BY_ALL
and no flags are set.
-
contentType
@AudioContentType public final @com.google.android.exoplayer2.C.AudioContentType int contentType
Deprecated.TheC.AudioContentType
.
-
flags
@AudioFlags public final @com.google.android.exoplayer2.C.AudioFlags int flags
Deprecated.TheC.AudioFlags
.
-
usage
@AudioUsage public final @com.google.android.exoplayer2.C.AudioUsage int usage
Deprecated.TheC.AudioUsage
.
-
allowedCapturePolicy
@AudioAllowedCapturePolicy public final @com.google.android.exoplayer2.C.AudioAllowedCapturePolicy int allowedCapturePolicy
Deprecated.
-
spatializationBehavior
public final @com.google.android.exoplayer2.C.SpatializationBehavior int spatializationBehavior
Deprecated.
-
CREATOR
public static final Bundleable.Creator<AudioAttributes> CREATOR
Deprecated.Object that can restoreAudioAttributes
from aBundle
.
-
-
Method Detail
-
getAudioAttributesV21
@RequiresApi(21) public AudioAttributes.AudioAttributesV21 getAudioAttributesV21()
Deprecated.Returns aAudioAttributes.AudioAttributesV21
from this instance.Some fields are ignored if the corresponding
AudioAttributes.Builder
setter is not available on the current API level.
-
toBundle
public Bundle toBundle()
Deprecated.Description copied from interface:Bundleable
Returns aBundle
representing the information stored in this object.- Specified by:
toBundle
in interfaceBundleable
-
-