Back to Exoplayer

AudioAttributes (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/audio/AudioAttributes.html

latest8.8 KB
Original Source

Package com.google.android.exoplayer2.audio

Class AudioAttributes

  • java.lang.Object

    • com.google.android.exoplayer2.audio.AudioAttributes
  • 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 Class Summary

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. |

- 

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.

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. |

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 a AudioAttributes.AudioAttributesV21 from this instance. | | int | hashCode() | Deprecated. | | Bundle | toBundle() | Deprecated.

Returns a Bundle representing the information stored in this object. |

- 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

DEFAULT

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.

- 

contentType

[@AudioContentType](../C.AudioContentType.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.AudioContentType int contentType

Deprecated.

The C.AudioContentType.

- 

flags

[@AudioFlags](../C.AudioFlags.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.AudioFlags int flags

Deprecated.

The C.AudioFlags.

- 

usage

[@AudioUsage](../C.AudioUsage.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.AudioUsage int usage

Deprecated.

The C.AudioUsage.

- 

allowedCapturePolicy

[@AudioAllowedCapturePolicy](../C.AudioAllowedCapturePolicy.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.AudioAllowedCapturePolicy int allowedCapturePolicy

Deprecated.

The C.AudioAllowedCapturePolicy.

- 

spatializationBehavior

public final @com.google.android.exoplayer2.C.SpatializationBehavior int spatializationBehavior

Deprecated.

The C.SpatializationBehavior.

- 

CREATOR

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.

Method Detail

- 

getAudioAttributesV21

@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.

- 

equals

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

- 

hashCode

public int hashCode()

Deprecated. Overrides:hashCode in class Object

- 

toBundle

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