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

# AudioProfile

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/media/EncoderProfiles.AudioProfile "View this page in Java")

```
class AudioProfile
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.media.EncoderProfiles.AudioProfile](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.AudioProfile#) |

Configuration for an audio encoder.

## Summary

| Public methods ||
|---|---|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.AudioProfile#getBitrate()()` The target audio output bitrate in bits per second |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.AudioProfile#getChannels()()` The number of audio channels used for the audio track |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.AudioProfile#getCodec()()` The audio encoder being used for the audio track. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.AudioProfile#getMediaType()()` The media type of the audio encoder being used for the video track |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.AudioProfile#getProfile()()` The audio encoder profile being used for the audio track |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.AudioProfile#getSampleRate()()` The audio sampling rate used for the audio track |

## Public methods

### getBitrate

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

```
fun getBitrate(): Int
```

The target audio output bitrate in bits per second

### getChannels

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

```
fun getChannels(): Int
```

The number of audio channels used for the audio track

### getCodec

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

```
fun getCodec(): Int
```

The audio encoder being used for the audio track.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | Value is one of the following: - `https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioEncoder#DEFAULT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioEncoder#AMR_NB:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioEncoder#AMR_WB:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioEncoder#AAC:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioEncoder#HE_AAC:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioEncoder#AAC_ELD:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioEncoder#VORBIS:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioEncoder#OPUS:kotlin.Int` |

**See Also**

- `https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioEncoder`

### getMediaType

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

```
fun getMediaType(): String
```

The media type of the audio encoder being used for the video track

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | This value cannot be `null`. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/media/MediaFormat#KEY_MIME:kotlin.String`

### getProfile

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

```
fun getProfile(): Int
```

The audio encoder profile being used for the audio track

This value is negative if there is no profile defined for the audio codec.
**See Also**

- `https://developer.android.com/reference/kotlin/android/media/MediaFormat#KEY_PROFILE:kotlin.String`

### getSampleRate

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

```
fun getSampleRate(): Int
```

The audio sampling rate used for the audio track