Back to Exoplayer

AudioCapabilities (ExoPlayer library)

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

latest7.2 KB
Original Source

Package com.google.android.exoplayer2.audio

Class AudioCapabilities


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classAudioCapabilitiesextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

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.

Represents the set of audio formats that a device is capable of playing.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static AudioCapabilities | DEFAULT_AUDIO_CAPABILITIES | Deprecated.

The minimum audio capabilities supported by all devices. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | AudioCapabilities​(int[] supportedEncodings, int maxChannelCount) | Deprecated.

Constructs new audio capabilities based on a set of supported encodings and a maximum channel count. |

Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | boolean | equals​(Object other) | Deprecated. | | static AudioCapabilities | getCapabilities​(Context context) | Deprecated.

Returns the current audio capabilities for the device. | | Pair<Integer,​Integer> | getEncodingAndChannelConfigForPassthrough​(Format format) | Deprecated.

Returns the encoding and channel config to use when configuring an AudioTrack in passthrough mode for the specified Format. | | int | getMaxChannelCount() | Deprecated.

Returns the maximum number of channels the device can play at the same time. | | int | hashCode() | Deprecated. | | boolean | isPassthroughPlaybackSupported​(Format format) | Deprecated.

Returns whether the device can do passthrough playback for format. | | boolean | supportsEncoding​(@com.google.android.exoplayer2.C.Encoding int encoding) | Deprecated.

Returns whether this device supports playback of the specified audio encoding. | | String | toString() | Deprecated. |

- 

Methods inherited from class java.lang.Object

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

Field Detail

- 

DEFAULT_AUDIO_CAPABILITIES

public static final[AudioCapabilities](AudioCapabilities.html "class in com.google.android.exoplayer2.audio")DEFAULT_AUDIO_CAPABILITIES

Deprecated.

The minimum audio capabilities supported by all devices.

Constructor Detail

- 

AudioCapabilities

public AudioCapabilities​(@Nullable
                         int[] supportedEncodings,
                         int maxChannelCount)

Deprecated.

Constructs new audio capabilities based on a set of supported encodings and a maximum channel count.

Applications should generally call getCapabilities(Context) to obtain an instance based on the capabilities advertised by the platform, rather than calling this constructor.

Parameters:supportedEncodings - Supported audio encodings from AudioFormat's ENCODING_* constants. Passing null indicates that no encodings are supported.maxChannelCount - The maximum number of audio channels that can be played simultaneously.

Method Detail

- 

getCapabilities

public static[AudioCapabilities](AudioCapabilities.html "class in com.google.android.exoplayer2.audio")getCapabilities​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context)

Deprecated.

Returns the current audio capabilities for the device. Parameters:context - A context for obtaining the current audio capabilities.Returns:The current audio capabilities for the device.

- 

supportsEncoding

public boolean supportsEncoding​(@com.google.android.exoplayer2.C.Encoding int encoding)

Deprecated.

Returns whether this device supports playback of the specified audio encoding. Parameters:encoding - One of C.Encoding's ENCODING_* constants.Returns:Whether this device supports playback the specified audio encoding.

- 

getMaxChannelCount

public int getMaxChannelCount()

Deprecated.

Returns the maximum number of channels the device can play at the same time.

- 

isPassthroughPlaybackSupported

public boolean isPassthroughPlaybackSupported​([Format](../Format.html "class in com.google.android.exoplayer2")format)

Deprecated.

Returns whether the device can do passthrough playback for format.

- 

getEncodingAndChannelConfigForPassthrough

@Nullable
public[Pair](https://developer.android.com/reference/android/util/Pair.html "class or interface in android.util")<[Integer](https://developer.android.com/reference/java/lang/Integer.html?is-external=true "class or interface in java.lang"),​[Integer](https://developer.android.com/reference/java/lang/Integer.html?is-external=true "class or interface in java.lang")> getEncodingAndChannelConfigForPassthrough​([Format](../Format.html "class in com.google.android.exoplayer2")format)

Deprecated.

Returns the encoding and channel config to use when configuring an AudioTrack in passthrough mode for the specified Format. Returns null if passthrough of the format is unsupported. Parameters:format - The Format.Returns:The encoding and channel config to use, or null if passthrough of the format is unsupported.

- 

equals

public boolean equals​(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")other)

Deprecated. Overrides:equals in class Object

- 

hashCode

public int hashCode()

Deprecated. Overrides:hashCode in class Object

- 

toString

public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")toString()

Deprecated. Overrides:toString in class Object