Added in API level 21

MediaCodecInfo.AudioCapabilities

public static final class MediaCodecInfo.AudioCapabilities
extends Object

java.lang.Object
   ↳ android.media.MediaCodecInfo.AudioCapabilities


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

Summary

Public methods

Range<Integer> getBitrateRange()

Returns the range of supported bitrates in bits/second.

Range[]<Integer> getInputChannelCountRanges()
int getMaxInputChannelCount()

Returns the maximum number of input channels supported.

int getMinInputChannelCount()

Returns the minimum number of input channels supported.

Range[]<Integer> getSupportedSampleRateRanges()

Returns the array of supported sample rate ranges.

int[] getSupportedSampleRates()

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

boolean isSampleRateSupported(int sampleRate)

Query whether the sample rate is supported by the codec.

Inherited methods

Public methods

getBitrateRange

Added in API level 21
public Range<Integer> getBitrateRange ()

Returns the range of supported bitrates in bits/second.

Returns
Range<Integer>

getInputChannelCountRanges

Added in API level 31
public Range[]<Integer> getInputChannelCountRanges ()

Returns
Range[]<Integer> This value cannot be null.

getMaxInputChannelCount

Added in API level 21
public int getMaxInputChannelCount ()

Returns the maximum number of input channels supported. Through Build.VERSION_CODES.R, this method indicated support for any number of input channels between 1 and this maximum value. As of Build.VERSION_CODES.S, the implied lower limit of 1 channel is no longer valid. As of 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()

Returns
int Value is between 1 and 255 inclusive

getMinInputChannelCount

Added in API level 31
public int getMinInputChannelCount ()

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().

Returns
int Value is between 1 and 255 inclusive

getSupportedSampleRateRanges

Added in API level 21
public Range[]<Integer> getSupportedSampleRateRanges ()

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

Returns
Range[]<Integer>

getSupportedSampleRates

Added in API level 21
public int[] getSupportedSampleRates ()

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.

Returns
int[]

isSampleRateSupported

Added in API level 21
public boolean isSampleRateSupported (int sampleRate)

Query whether the sample rate is supported by the codec.

Parameters
sampleRate int

Returns
boolean