# AudioRecord.MetricsConstants

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

# MetricsConstants

*** ** * ** ***

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

```
class MetricsConstants
```

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

## Summary

|                                                                                                                                                                                                              Constants                                                                                                                                                                                                              ||
|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CHANNELS](https://developer.android.com/reference/kotlin/android/media/AudioRecord.MetricsConstants#CHANNELS:kotlin.String) Key to extract the number of channels being recorded in this record track from the[AudioRecord.getMetrics](https://developer.android.com/reference/kotlin/android/media/AudioRecord#getMetrics())return value. |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ENCODING](https://developer.android.com/reference/kotlin/android/media/AudioRecord.MetricsConstants#ENCODING:kotlin.String) Key to extract the audio data encoding for this track from the[AudioRecord.getMetrics](https://developer.android.com/reference/kotlin/android/media/AudioRecord#getMetrics())return value.                     |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [LATENCY](https://developer.android.com/reference/kotlin/android/media/AudioRecord.MetricsConstants#LATENCY:kotlin.String) Key to extract the estimated latency through the recording pipeline from the[AudioRecord.getMetrics](https://developer.android.com/reference/kotlin/android/media/AudioRecord#getMetrics())return value.         |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SAMPLERATE](https://developer.android.com/reference/kotlin/android/media/AudioRecord.MetricsConstants#SAMPLERATE:kotlin.String) Key to extract the sink sample rate for this record track in Hz from the[AudioRecord.getMetrics](https://developer.android.com/reference/kotlin/android/media/AudioRecord#getMetrics())return value.       |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SOURCE](https://developer.android.com/reference/kotlin/android/media/AudioRecord.MetricsConstants#SOURCE:kotlin.String) Key to extract the source type for this track from the[AudioRecord.getMetrics](https://developer.android.com/reference/kotlin/android/media/AudioRecord#getMetrics())return value.                                 |

## Constants

### CHANNELS

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

```
static val CHANNELS: String
```

Key to extract the number of channels being recorded in this record track from the[AudioRecord.getMetrics](https://developer.android.com/reference/kotlin/android/media/AudioRecord#getMetrics())return value. The value is an`int`.  

    Value: "android.media.audiorecord.channels"

### ENCODING

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

```
static val ENCODING: String
```

Key to extract the audio data encoding for this track from the[AudioRecord.getMetrics](https://developer.android.com/reference/kotlin/android/media/AudioRecord#getMetrics())return value. The value is a`String`.  

    Value: "android.media.audiorecord.encoding"

### LATENCY

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

```
static val LATENCY: String
```

**Deprecated:** *Not properly supported in the past.*

Key to extract the estimated latency through the recording pipeline from the[AudioRecord.getMetrics](https://developer.android.com/reference/kotlin/android/media/AudioRecord#getMetrics())return value. This is in units of milliseconds. The value is an`int`.  

    Value: "android.media.audiorecord.latency"

### SAMPLERATE

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

```
static val SAMPLERATE: String
```

Key to extract the sink sample rate for this record track in Hz from the[AudioRecord.getMetrics](https://developer.android.com/reference/kotlin/android/media/AudioRecord#getMetrics())return value. The value is an`int`.  

    Value: "android.media.audiorecord.samplerate"

### SOURCE

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

```
static val SOURCE: String
```

Key to extract the source type for this track from the[AudioRecord.getMetrics](https://developer.android.com/reference/kotlin/android/media/AudioRecord#getMetrics())return value. The value is a`String`.  

    Value: "android.media.audiorecord.source"