Stay organized with collections
Save and categorize content based on your preferences.
AudioProfile
class AudioProfile
Configuration for an audio encoder.
Summary
Public methods |
Int |
The target audio output bitrate in bits per second
|
Int |
The number of audio channels used for the audio track
|
Int |
The audio encoder being used for the audio track.
|
String |
The media type of the audio encoder being used for the video track
|
Int |
The audio encoder profile being used for the audio track
|
Int |
The audio sampling rate used for the audio track
|
Public methods
getBitrate
fun getBitrate(): Int
The target audio output bitrate in bits per second
getChannels
fun getChannels(): Int
The number of audio channels used for the audio track
getCodec
fun getCodec(): Int
The audio encoder being used for the audio track.
fun getMediaType(): String
The media type of the audio encoder being used for the video track
Return |
String |
This value cannot be null . |
getProfile
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.
getSampleRate
fun getSampleRate(): Int
The audio sampling rate used for the audio track
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,["# EncoderProfiles.AudioProfile\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nAudioProfile\n============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/EncoderProfiles.AudioProfile \"View this page in Java\") \n\n```\nclass AudioProfile\n```\n\n|---|-------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.EncoderProfiles.AudioProfile](#) |\n\nConfiguration for an audio encoder.\n\nSummary\n-------\n\n| Public methods ||\n|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getBitrate](#getBitrate())`()` The target audio output bitrate in bits per second |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getChannels](#getChannels())`()` The number of audio channels used for the audio track |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getCodec](#getCodec())`()` The audio encoder being used for the audio track. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getMediaType](#getMediaType())`()` The media type of the audio encoder being used for the video track |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getProfile](#getProfile())`()` The audio encoder profile being used for the audio track |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getSampleRate](#getSampleRate())`()` The audio sampling rate used for the audio track |\n\nPublic methods\n--------------\n\n### getBitrate\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getBitrate(): Int\n```\n\nThe target audio output bitrate in bits per second \n\n### getChannels\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getChannels(): Int\n```\n\nThe number of audio channels used for the audio track \n\n### getCodec\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getCodec(): Int\n```\n\nThe audio encoder being used for the audio track.\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Value is [android.media.MediaRecorder.AudioEncoder#DEFAULT](/reference/kotlin/android/media/MediaRecorder.AudioEncoder#DEFAULT:kotlin.Int), [android.media.MediaRecorder.AudioEncoder#AMR_NB](/reference/kotlin/android/media/MediaRecorder.AudioEncoder#AMR_NB:kotlin.Int), [android.media.MediaRecorder.AudioEncoder#AMR_WB](/reference/kotlin/android/media/MediaRecorder.AudioEncoder#AMR_WB:kotlin.Int), [android.media.MediaRecorder.AudioEncoder#AAC](/reference/kotlin/android/media/MediaRecorder.AudioEncoder#AAC:kotlin.Int), [android.media.MediaRecorder.AudioEncoder#HE_AAC](/reference/kotlin/android/media/MediaRecorder.AudioEncoder#HE_AAC:kotlin.Int), [android.media.MediaRecorder.AudioEncoder#AAC_ELD](/reference/kotlin/android/media/MediaRecorder.AudioEncoder#AAC_ELD:kotlin.Int), [android.media.MediaRecorder.AudioEncoder#VORBIS](/reference/kotlin/android/media/MediaRecorder.AudioEncoder#VORBIS:kotlin.Int), or [android.media.MediaRecorder.AudioEncoder#OPUS](/reference/kotlin/android/media/MediaRecorder.AudioEncoder#OPUS:kotlin.Int) |\n\n**See Also**\n\n- [android.media.MediaRecorder.AudioEncoder](/reference/kotlin/android/media/MediaRecorder.AudioEncoder) \n\n### getMediaType\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getMediaType(): String\n```\n\nThe media type of the audio encoder being used for the video track\n\n| Return ||\n|----------------------------------------------------------------------------------|------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be `null`. |\n\n**See Also**\n\n- [android.media.MediaFormat#KEY_MIME](/reference/kotlin/android/media/MediaFormat#KEY_MIME:kotlin.String) \n\n### getProfile\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getProfile(): Int\n```\n\nThe audio encoder profile being used for the audio track\n\nThis value is negative if there is no profile defined for the audio codec. \n**See Also**\n\n- [android.media.MediaFormat#KEY_PROFILE](/reference/kotlin/android/media/MediaFormat#KEY_PROFILE:kotlin.String) \n\n### getSampleRate\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getSampleRate(): Int\n```\n\nThe audio sampling rate used for the audio track"]]