Class AudioCapabilities
- java.lang.Object
-
- com.google.android.exoplayer2.audio.AudioCapabilities
-
@Deprecated public final class AudioCapabilities extends Object
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 AudioCapabilitiesDEFAULT_AUDIO_CAPABILITIESDeprecated.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 booleanequals(Object other)Deprecated.static AudioCapabilitiesgetCapabilities(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 anAudioTrackin passthrough mode for the specifiedFormat.intgetMaxChannelCount()Deprecated.Returns the maximum number of channels the device can play at the same time.inthashCode()Deprecated.booleanisPassthroughPlaybackSupported(Format format)Deprecated.Returns whether the device can do passthrough playback forformat.booleansupportsEncoding(@com.google.android.exoplayer2.C.Encoding int encoding)Deprecated.Returns whether this device supports playback of the specified audioencoding.StringtoString()Deprecated.
-
-
-
Field Detail
-
DEFAULT_AUDIO_CAPABILITIES
public static final AudioCapabilities 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 fromAudioFormat'sENCODING_*constants. Passingnullindicates that no encodings are supported.maxChannelCount- The maximum number of audio channels that can be played simultaneously.
-
-
Method Detail
-
getCapabilities
public static AudioCapabilities getCapabilities(Context 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 audioencoding.- Parameters:
encoding- One ofC.Encoding'sENCODING_*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)
Deprecated.Returns whether the device can do passthrough playback forformat.
-
getEncodingAndChannelConfigForPassthrough
@Nullable public Pair<Integer,Integer> getEncodingAndChannelConfigForPassthrough(Format format)
Deprecated.Returns the encoding and channel config to use when configuring anAudioTrackin passthrough mode for the specifiedFormat. Returnsnullif passthrough of the format is unsupported.- Parameters:
format- TheFormat.- Returns:
- The encoding and channel config to use, or
nullif passthrough of the format is unsupported.
-
-