public final class AudioCapabilities extends Object
| Modifier and Type | Field | Description |
|---|---|---|
static AudioCapabilities |
DEFAULT_AUDIO_CAPABILITIES |
The minimum audio capabilities supported by all devices.
|
| Constructor | Description |
|---|---|
AudioCapabilities(int[] supportedEncodings,
int maxChannelCount) |
Constructs new audio capabilities based on a set of supported encodings and a maximum channel
count.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(Object other) |
|
static AudioCapabilities |
getCapabilities(Context context) |
Returns the current audio capabilities for the device.
|
int |
getMaxChannelCount() |
Returns the maximum number of channels the device can play at the same time.
|
int |
hashCode() |
|
boolean |
supportsEncoding(int encoding) |
Returns whether this device supports playback of the specified audio
encoding. |
String |
toString() |
public static final AudioCapabilities DEFAULT_AUDIO_CAPABILITIES
public AudioCapabilities(@Nullable
int[] supportedEncodings,
int maxChannelCount)
Applications should generally call getCapabilities(Context) to obtain an instance
based on the capabilities advertised by the platform, rather than calling this constructor.
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.public static AudioCapabilities getCapabilities(Context context)
context - A context for obtaining the current audio capabilities.public boolean supportsEncoding(@Encoding int encoding)
encoding.encoding - One of C.Encoding's ENCODING_* constants.encoding.public int getMaxChannelCount()