Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/media/MediaCodecInfo.AudioCapabilities#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/media/MediaCodecInfo.AudioCapabilities#inhmethods)

# MediaCodecInfo.AudioCapabilities

*** ** * ** ***

` public static final class MediaCodecInfo.AudioCapabilities `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.MediaCodecInfo.AudioCapabilities |

<br />

*** ** * ** ***

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

## Summary

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>` | ` https://developer.android.com/reference/android/media/MediaCodecInfo.AudioCapabilities#getBitrateRange()() ` Returns the range of supported bitrates in bits/second. |
| ` https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>` | ` https://developer.android.com/reference/android/media/MediaCodecInfo.AudioCapabilities#getInputChannelCountRanges()() ` |
| ` int` | ` https://developer.android.com/reference/android/media/MediaCodecInfo.AudioCapabilities#getMaxInputChannelCount()() ` Returns the maximum number of input channels supported. |
| ` int` | ` https://developer.android.com/reference/android/media/MediaCodecInfo.AudioCapabilities#getMinInputChannelCount()() ` Returns the minimum number of input channels supported. |
| ` https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>` | ` https://developer.android.com/reference/android/media/MediaCodecInfo.AudioCapabilities#getSupportedSampleRateRanges()() ` Returns the array of supported sample rate ranges. |
| ` int[]` | ` https://developer.android.com/reference/android/media/MediaCodecInfo.AudioCapabilities#getSupportedSampleRates()() ` Returns the array of supported sample rates if the codec supports only discrete values. |
| ` boolean` | ` https://developer.android.com/reference/android/media/MediaCodecInfo.AudioCapabilities#isSampleRateSupported(int)(int sampleRate) ` Query whether the sample rate is supported by the codec. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### getBitrateRange

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Range<Integer> getBitrateRange ()
```

Returns the range of supported bitrates in bits/second.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>` | <br /> |

### getInputChannelCountRanges

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Range[]<Integer> getInputChannelCountRanges ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>` | This value cannot be `null`. <br /> |

### getMaxInputChannelCount

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMaxInputChannelCount ()
```

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

<br />

| Returns ||
|---|---|
| `int` | Value is between 1 and 255 inclusive <br /> |

### getMinInputChannelCount

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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 `https://developer.android.com/reference/android/media/MediaCodecInfo.AudioCapabilities#getInputChannelCountRanges()`.

<br />

| Returns ||
|---|---|
| `int` | Value is between 1 and 255 inclusive <br /> |

### getSupportedSampleRateRanges

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Range[]<Integer> getSupportedSampleRateRanges ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>` | <br /> |

### getSupportedSampleRates

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Returns ||
|---|---|
| `int[]` | <br /> |

### isSampleRateSupported

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isSampleRateSupported (int sampleRate)
```

Query whether the sample rate is supported by the codec.

<br />

| Parameters ||
|---|---|
| `sampleRate` | `int` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |