Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

# AudioTrack.OnCodecFormatChangedListener

*** ** * ** ***

` public static interface AudioTrack.OnCodecFormatChangedListener `   
` `

|---|
| android.media.AudioTrack.OnCodecFormatChangedListener |

<br />

*** ** * ** ***

Interface definition for a listener for codec format changes.

## Summary

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/media/AudioTrack.OnCodecFormatChangedListener#onCodecFormatChanged(android.media.AudioTrack,%20android.media.AudioMetadataReadMap)(https://developer.android.com/reference/android/media/AudioTrack audioTrack, https://developer.android.com/reference/android/media/AudioMetadataReadMap info) ` Called when the compressed codec format changes. |

## Public methods

### onCodecFormatChanged

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void onCodecFormatChanged (AudioTrack audioTrack, 
                AudioMetadataReadMap info)
```

Called when the compressed codec format changes.

<br />

| Parameters ||
|---|---|
| `audioTrack` | `AudioTrack`: is the `AudioTrack` instance associated with the codec. This value cannot be `null`. <br /> |
| `info` | `AudioMetadataReadMap`: is a `https://developer.android.com/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`. <br /> |