Stay organized with collections
Save and categorize content based on your preferences.
interface OnCodecFormatChangedListener
Interface definition for a listener for codec format changes.
Summary
Public methods |
abstract Unit |
Called when the compressed codec format changes.
|
Public methods
abstract fun onCodecFormatChanged(
audioTrack: AudioTrack,
info: AudioMetadataReadMap?
): Unit
Called when the compressed codec format changes.
Parameters |
audioTrack |
AudioTrack: is the AudioTrack instance associated with the codec. This value cannot be null . |
info |
AudioMetadataReadMap?: is a AudioMetadataReadMap of values which contains decoded format changes reported by the codec. Not all hardware codecs indicate codec format changes. Acceptable keys are taken from AudioMetadata.Format.KEY_* range, with the associated value type. This value may be null . |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# AudioTrack.OnCodecFormatChangedListener\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnCodecFormatChangedListener\n============================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/AudioTrack.OnCodecFormatChangedListener \"View this page in Java\") \n\n```\ninterface OnCodecFormatChangedListener\n```\n\n|------------------------------------------------------------|\n| [android.media.AudioTrack.OnCodecFormatChangedListener](#) |\n\nInterface definition for a listener for codec format changes.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCodecFormatChanged](#onCodecFormatChanged(android.media.AudioTrack,%20android.media.AudioMetadataReadMap))`(`audioTrack:` `[AudioTrack](/reference/kotlin/android/media/AudioTrack)`, `info:` `[AudioMetadataReadMap](/reference/kotlin/android/media/AudioMetadataReadMap)?`)` Called when the compressed codec format changes. |\n\nPublic methods\n--------------\n\n### onCodecFormatChanged\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onCodecFormatChanged(\n audioTrack: AudioTrack, \n info: AudioMetadataReadMap?\n): Unit\n```\n\nCalled when the compressed codec format changes.\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `audioTrack` | [AudioTrack](/reference/kotlin/android/media/AudioTrack): is the `AudioTrack` instance associated with the codec. This value cannot be `null`. |\n| `info` | [AudioMetadataReadMap](/reference/kotlin/android/media/AudioMetadataReadMap)?: is a [AudioMetadataReadMap](/reference/kotlin/android/media/AudioMetadataReadMap) of values which contains decoded format changes reported by the codec. Not all hardware codecs indicate codec format changes. Acceptable keys are taken from `AudioMetadata.Format.KEY_*` range, with the associated value type. This value may be `null`. |"]]