Stay organized with collections
Save and categorize content based on your preferences.
MetricsConstants
class MetricsConstants
Summary
Constants
CHANNELS
static val CHANNELS: String
Key to extract the number of channels being recorded in this record track from the AudioRecord.getMetrics
return value. The value is an int
.
Value: "android.media.audiorecord.channels"
ENCODING
static val ENCODING: String
Key to extract the audio data encoding for this track from the AudioRecord.getMetrics
return value. The value is a String
.
Value: "android.media.audiorecord.encoding"
LATENCY
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
return value. This is in units of milliseconds. The value is an int
.
Value: "android.media.audiorecord.latency"
SAMPLERATE
static val SAMPLERATE: String
Key to extract the sink sample rate for this record track in Hz from the AudioRecord.getMetrics
return value. The value is an int
.
Value: "android.media.audiorecord.samplerate"
SOURCE
static val SOURCE: String
Key to extract the source type for this track from the AudioRecord.getMetrics
return value. The value is a String
.
Value: "android.media.audiorecord.source"
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# AudioRecord.MetricsConstants\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nMetricsConstants\n================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/AudioRecord.MetricsConstants \"View this page in Java\") \n\n```\nclass MetricsConstants\n```\n\n|---|-------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.AudioRecord.MetricsConstants](#) |\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CHANNELS](#CHANNELS:kotlin.String) Key to extract the number of channels being recorded in this record track from the [AudioRecord.getMetrics](/reference/kotlin/android/media/AudioRecord#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ENCODING](#ENCODING:kotlin.String) Key to extract the audio data encoding for this track from the [AudioRecord.getMetrics](/reference/kotlin/android/media/AudioRecord#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [LATENCY](#LATENCY:kotlin.String) Key to extract the estimated latency through the recording pipeline from the [AudioRecord.getMetrics](/reference/kotlin/android/media/AudioRecord#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SAMPLERATE](#SAMPLERATE:kotlin.String) Key to extract the sink sample rate for this record track in Hz from the [AudioRecord.getMetrics](/reference/kotlin/android/media/AudioRecord#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SOURCE](#SOURCE:kotlin.String) Key to extract the source type for this track from the [AudioRecord.getMetrics](/reference/kotlin/android/media/AudioRecord#getMetrics()) return value. |\n\nConstants\n---------\n\n### CHANNELS\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CHANNELS: String\n```\n\nKey to extract the number of channels being recorded in this record track from the [AudioRecord.getMetrics](/reference/kotlin/android/media/AudioRecord#getMetrics()) return value. The value is an `int`. \n\n Value: \"android.media.audiorecord.channels\"\n\n### ENCODING\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ENCODING: String\n```\n\nKey to extract the audio data encoding for this track from the [AudioRecord.getMetrics](/reference/kotlin/android/media/AudioRecord#getMetrics()) return value. The value is a `String`. \n\n Value: \"android.media.audiorecord.encoding\"\n\n### LATENCY\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val LATENCY: String\n```\n\n**Deprecated:** *Not properly supported in the past.*\n\nKey to extract the estimated latency through the recording pipeline from the [AudioRecord.getMetrics](/reference/kotlin/android/media/AudioRecord#getMetrics()) return value. This is in units of milliseconds. The value is an `int`. \n\n Value: \"android.media.audiorecord.latency\"\n\n### SAMPLERATE\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SAMPLERATE: String\n```\n\nKey to extract the sink sample rate for this record track in Hz from the [AudioRecord.getMetrics](/reference/kotlin/android/media/AudioRecord#getMetrics()) return value. The value is an `int`. \n\n Value: \"android.media.audiorecord.samplerate\"\n\n### SOURCE\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SOURCE: String\n```\n\nKey to extract the source type for this track from the [AudioRecord.getMetrics](/reference/kotlin/android/media/AudioRecord#getMetrics()) return value. The value is a `String`. \n\n Value: \"android.media.audiorecord.source\""]]