AudioCapabilities
@UnstableApi
class AudioCapabilities
Represents the set of audio formats that a device is capable of playing.
Summary
Constants |
|
|---|---|
const AudioCapabilities! |
The minimum audio capabilities supported by all devices. |
Public constructors |
|---|
This function is deprecated. Use |
Public functions |
|
|---|---|
Boolean |
|
java-static AudioCapabilities! |
This function is deprecated. Use |
java-static AudioCapabilities! |
getCapabilities(Returns the current audio capabilities. |
Pair<Int!, Int!>? |
This function is deprecated. Use |
Pair<Int!, Int!>? |
getEncodingAndChannelConfigForPassthrough(Returns the encoding and channel config to use when configuring an |
Int |
hashCode() |
Boolean |
This function is deprecated. Use |
Boolean |
isPassthroughPlaybackSupported(Returns whether the device can do passthrough playback for |
Boolean |
supportsEncoding(@C.Encoding encoding: Int)Returns whether this device supports playback of the specified audio |
String! |
toString() |
Public properties |
|
|---|---|
Int |
Constants
DEFAULT_AUDIO_CAPABILITIES
const val DEFAULT_AUDIO_CAPABILITIES: AudioCapabilities!
The minimum audio capabilities supported by all devices.
Public constructors
Public functions
getCapabilities
java-static fun getCapabilities(
context: Context!,
audioAttributes: AudioAttributes!,
routedDevice: AudioDeviceInfo?
): AudioCapabilities!
Returns the current audio capabilities.
| Parameters | |
|---|---|
context: Context! |
A context for obtaining the current audio capabilities. |
audioAttributes: AudioAttributes! |
The |
routedDevice: AudioDeviceInfo? |
The |
| Returns | |
|---|---|
AudioCapabilities! |
The current audio capabilities for the device. |
getEncodingAndChannelConfigForPassthrough
fungetEncodingAndChannelConfigForPassthrough(format: Format!): Pair<Int!, Int!>?
getEncodingAndChannelConfigForPassthrough
fun getEncodingAndChannelConfigForPassthrough(
format: Format!,
audioAttributes: AudioAttributes!
): Pair<Int!, Int!>?
Returns the encoding and channel config to use when configuring an AudioTrack in passthrough mode for the specified Format and AudioAttributes. Returns
null if passthrough of the format is unsupported.
| Parameters | |
|---|---|
format: Format! |
The |
audioAttributes: AudioAttributes! |
The |
isPassthroughPlaybackSupported
fun isPassthroughPlaybackSupported(
format: Format!,
audioAttributes: AudioAttributes!
): Boolean
Returns whether the device can do passthrough playback for format.
supportsEncoding
fun supportsEncoding(@C.Encoding encoding: Int): Boolean
Returns whether this device supports playback of the specified audio encoding.
| Parameters | |
|---|---|
@C.Encoding encoding: Int |
One of |
| Returns | |
|---|---|
Boolean |
Whether this device supports playback the specified audio |