docs/doc/reference/com/google/android/exoplayer2/audio/AudioAttributes.html
Package com.google.android.exoplayer2.audio
All Implemented Interfaces:Bundleable
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classAudioAttributesextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Bundleable](../Bundleable.html "interface in com.google.android.exoplayer2")
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 platform AudioTrack.
To set the audio attributes, create an instance using the AudioAttributes.Builder and either pass it to the player or send a message of type Renderer#MSG_SET_AUDIO_ATTRIBUTES to the audio renderers.
This class is based on AudioAttributes, but can be used on all supported API versions.
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static class | AudioAttributes.AudioAttributesV21 |
Deprecated.
A direct wrapper around AudioAttributes.
|
| static class | AudioAttributes.Builder |
Deprecated.
Builder for AudioAttributes.
|
-
Bundleable.Creator<T extends Bundleable>
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| @com.google.android.exoplayer2.C.AudioAllowedCapturePolicy int | allowedCapturePolicy |
Deprecated.
The C.AudioAllowedCapturePolicy.
|
| @com.google.android.exoplayer2.C.AudioContentType int | contentType |
Deprecated.
The C.AudioContentType.
|
| static Bundleable.Creator<AudioAttributes> | CREATOR |
Deprecated.
Object that can restore AudioAttributes from a Bundle.
|
| static AudioAttributes | DEFAULT |
Deprecated.
The default audio attributes, where the content type is C.AUDIO_CONTENT_TYPE_UNKNOWN, usage is C.USAGE_MEDIA, capture policy is C.ALLOW_CAPTURE_BY_ALL and no flags are set.
|
| @com.google.android.exoplayer2.C.AudioFlags int | flags |
Deprecated.
The C.AudioFlags.
|
| @com.google.android.exoplayer2.C.SpatializationBehavior int | spatializationBehavior |
Deprecated.
The C.SpatializationBehavior.
|
| @com.google.android.exoplayer2.C.AudioUsage int | usage |
Deprecated.
The C.AudioUsage.
|
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| boolean | equals(Object obj) |
Deprecated.
|
| AudioAttributes.AudioAttributesV21 | getAudioAttributesV21() |
Deprecated.
Returns a AudioAttributes.AudioAttributesV21 from this instance.
|
| int | hashCode() |
Deprecated.
|
| Bundle | toBundle() |
Deprecated.
Returns a Bundle representing the information stored in this object.
|
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
public static final[AudioAttributes](AudioAttributes.html "class in com.google.android.exoplayer2.audio")DEFAULT
Deprecated.
The default audio attributes, where the content type is C.AUDIO_CONTENT_TYPE_UNKNOWN, usage is C.USAGE_MEDIA, capture policy is C.ALLOW_CAPTURE_BY_ALL and no flags are set.
-
[@AudioContentType](../C.AudioContentType.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.AudioContentType int contentType
Deprecated.
The C.AudioContentType.
-
[@AudioFlags](../C.AudioFlags.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.AudioFlags int flags
Deprecated.
The C.AudioFlags.
-
[@AudioUsage](../C.AudioUsage.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.AudioUsage int usage
Deprecated.
The C.AudioUsage.
-
[@AudioAllowedCapturePolicy](../C.AudioAllowedCapturePolicy.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.AudioAllowedCapturePolicy int allowedCapturePolicy
Deprecated.
The C.AudioAllowedCapturePolicy.
-
public final @com.google.android.exoplayer2.C.SpatializationBehavior int spatializationBehavior
Deprecated.
-
public static final[Bundleable.Creator](../Bundleable.Creator.html "interface in com.google.android.exoplayer2")<[AudioAttributes](AudioAttributes.html "class in com.google.android.exoplayer2.audio")> CREATOR
Deprecated.
Object that can restore AudioAttributes from a Bundle.
-
@RequiresApi(21)
public[AudioAttributes.AudioAttributesV21](AudioAttributes.AudioAttributesV21.html "class in com.google.android.exoplayer2.audio")getAudioAttributesV21()
Deprecated.
Returns a AudioAttributes.AudioAttributesV21 from this instance.
Some fields are ignored if the corresponding AudioAttributes.Builder setter is not available on the current API level.
-
public boolean equals(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")obj)
Deprecated.
Overrides:equals in class Object
-
public int hashCode()
Deprecated.
Overrides:hashCode in class Object
-
public[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")toBundle()
Deprecated.
Description copied from interface: Bundleable
Returns a Bundle representing the information stored in this object.
Specified by:toBundle in interface Bundleable