Added in API level 21

AudioCapabilities


class AudioCapabilities
kotlin.Any
   ↳ android.media.MediaCodecInfo.AudioCapabilities

A class that supports querying the audio capabilities of a codec.

Summary

Public methods
Range<Int!>!

Returns the range of supported bitrates in bits/second.

Array<Range<Int!>!>

Int

Returns the maximum number of input channels supported.

Int

Returns the minimum number of input channels supported.

Array<Range<Int!>!>!

Returns the array of supported sample rate ranges.

IntArray!

Returns the array of supported sample rates if the codec supports only discrete values.

Boolean

Query whether the sample rate is supported by the codec.

Public methods

getBitrateRange

Added in API level 21
fun getBitrateRange(): Range<Int!>!

Returns the range of supported bitrates in bits/second.

getInputChannelCountRanges

Added in API level 31
fun getInputChannelCountRanges(): Array<Range<Int!>!>
Return
Array<Range<Int!>!> This value cannot be null.

getMaxInputChannelCount

Added in API level 21
fun getMaxInputChannelCount(): Int

Returns the maximum number of input channels supported. Through android.os.Build.VERSION_CODES#R, this method indicated support for any number of input channels between 1 and this maximum value. As of android.os.Build.VERSION_CODES#S, the implied lower limit of 1 channel is no longer valid. As of android.os.Build.VERSION_CODES#S, getMaxInputChannelCount is superseded by getInputChannelCountRanges, which returns an array of ranges of channels. The getMaxInputChannelCount method will return the highest value in the ranges returned by getInputChannelCountRanges

Return
Int Value is between 1 and 255 inclusive

getMinInputChannelCount

Added in API level 31
fun getMinInputChannelCount(): Int

Returns the minimum number of input channels supported. This is often 1, but does vary for certain mime types. This returns the lowest channel count in the ranges returned by getInputChannelCountRanges.

Return
Int Value is between 1 and 255 inclusive

getSupportedSampleRateRanges

Added in API level 21
fun getSupportedSampleRateRanges(): Array<Range<Int!>!>!

Returns the array of supported sample rate ranges. The array is sorted in ascending order, and the ranges are distinct.

getSupportedSampleRates

Added in API level 21
fun getSupportedSampleRates(): IntArray!

Returns the array of supported sample rates if the codec supports only discrete values. Otherwise, it returns null. The array is sorted in ascending order.

isSampleRateSupported

Added in API level 21
fun isSampleRateSupported(sampleRate: Int): Boolean

Query whether the sample rate is supported by the codec.