Stay organized with collections
Save and categorize content based on your preferences.
MetricsConstants
class MetricsConstants
Summary
Constants
CHANNELMASK
static val CHANNELMASK: String
Deprecated: This does not work. Use AudioTrack.getFormat()
and read from the returned format instead.
Key to extract the native channel mask information for this track from the AudioTrack.getMetrics
return value. The value is a long
.
Value: "android.media.audiorecord.channelmask"
CONTENTTYPE
static val CONTENTTYPE: String
Key to extract the attribute content type for this track from the AudioTrack.getMetrics
return value. The value is a String
.
Value: "android.media.audiotrack.type"
SAMPLERATE
static val SAMPLERATE: String
Deprecated: This does not work. Use AudioTrack.getSampleRate()
instead.
Key to extract the sample rate for this track in Hz from the AudioTrack.getMetrics
return value. The value is an int
.
Value: "android.media.audiorecord.samplerate"
USAGE
static val USAGE: String
Key to extract the attribute usage for this track from the AudioTrack.getMetrics
return value. The value is a String
.
Value: "android.media.audiotrack.usage"
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,["# AudioTrack.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/AudioTrack.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.AudioTrack.MetricsConstants](#) |\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CHANNELMASK](#CHANNELMASK:kotlin.String) Key to extract the native channel mask information for this track from the [AudioTrack.getMetrics](/reference/kotlin/android/media/AudioTrack#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTENTTYPE](#CONTENTTYPE:kotlin.String) Key to extract the attribute content type for this track from the [AudioTrack.getMetrics](/reference/kotlin/android/media/AudioTrack#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 sample rate for this track in Hz from the [AudioTrack.getMetrics](/reference/kotlin/android/media/AudioTrack#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [STREAMTYPE](#STREAMTYPE:kotlin.String) Key to extract the stream type for this track from the [AudioTrack.getMetrics](/reference/kotlin/android/media/AudioTrack#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [USAGE](#USAGE:kotlin.String) Key to extract the attribute usage for this track from the [AudioTrack.getMetrics](/reference/kotlin/android/media/AudioTrack#getMetrics()) return value. |\n\nConstants\n---------\n\n### CHANNELMASK\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 CHANNELMASK: String\n```\n\n**Deprecated:** *This does not work. Use [AudioTrack.getFormat()](/reference/kotlin/android/media/AudioTrack#getFormat()) and read from the returned format instead.*\n\nKey to extract the native channel mask information for this track from the [AudioTrack.getMetrics](/reference/kotlin/android/media/AudioTrack#getMetrics()) return value. The value is a `long`. \n\n Value: \"android.media.audiorecord.channelmask\"\n\n### CONTENTTYPE\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CONTENTTYPE: String\n```\n\nKey to extract the attribute content type for this track from the [AudioTrack.getMetrics](/reference/kotlin/android/media/AudioTrack#getMetrics()) return value. The value is a `String`. \n\n Value: \"android.media.audiotrack.type\"\n\n### SAMPLERATE\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 SAMPLERATE: String\n```\n\n**Deprecated:** *This does not work. Use [AudioTrack.getSampleRate()](/reference/kotlin/android/media/AudioTrack#getSampleRate()) instead.*\n\nKey to extract the sample rate for this track in Hz from the [AudioTrack.getMetrics](/reference/kotlin/android/media/AudioTrack#getMetrics()) return value. The value is an `int`. \n\n Value: \"android.media.audiorecord.samplerate\"\n\n### STREAMTYPE\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val STREAMTYPE: String\n```\n\nKey to extract the stream type for this track from the [AudioTrack.getMetrics](/reference/kotlin/android/media/AudioTrack#getMetrics()) return value. This value may not exist in API level [android.os.Build.VERSION_CODES#P](../os/Build.VERSION_CODES.html#P:kotlin.Int). The value is a `String`. \n\n Value: \"android.media.audiotrack.streamtype\"\n\n### USAGE\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val USAGE: String\n```\n\nKey to extract the attribute usage for this track from the [AudioTrack.getMetrics](/reference/kotlin/android/media/AudioTrack#getMetrics()) return value. The value is a `String`. \n\n Value: \"android.media.audiotrack.usage\""]]