Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
AudioTrack.OnCodecFormatChangedListener
android.media.AudioTrack.OnCodecFormatChangedListener
|
Interface definition for a listener for codec format changes.
Summary
Public methods
public abstract void onCodecFormatChanged (AudioTrack audioTrack,
AudioMetadataReadMap info)
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](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nAudioTrack.OnCodecFormatChangedListener\n=======================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/AudioTrack.OnCodecFormatChangedListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nAudioTrack.OnCodecFormatChangedListener\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------------------|\n| android.media.AudioTrack.OnCodecFormatChangedListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition for a listener for codec format changes.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onCodecFormatChanged](/reference/android/media/AudioTrack.OnCodecFormatChangedListener#onCodecFormatChanged(android.media.AudioTrack,%20android.media.AudioMetadataReadMap))`(`[AudioTrack](/reference/android/media/AudioTrack)` audioTrack, `[AudioMetadataReadMap](/reference/android/media/AudioMetadataReadMap)` info) ` Called when the compressed codec format changes. |\n\nPublic methods\n--------------\n\n### onCodecFormatChanged\n\nAdded in [API level 30](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onCodecFormatChanged (AudioTrack audioTrack, \n AudioMetadataReadMap info)\n```\n\nCalled when the compressed codec format changes.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `audioTrack` | `AudioTrack`: is the `AudioTrack` instance associated with the codec. This value cannot be `null`. \u003cbr /\u003e |\n| `info` | `AudioMetadataReadMap`: is a [AudioMetadataReadMap](/reference/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`. \u003cbr /\u003e |"]]