# Id3Peeker

Artifact: [androidx.media3:media3-extractor](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/extractor/Id3Peeker.java+class:androidx.media3.extractor.Id3Peeker)

*** ** * ** ***


```
@UnstableApi
public final class Id3Peeker
```

<br />

*** ** * ** ***

Peeks data from the beginning of an `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput` to determine if there is any ID3 tag.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/extractor/Id3Peeker#Id3Peeker()()` |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/Metadata` | `@https://checkerframework.org/api/com/google/errorprone/annotations/InlineMe.html(replacement = "this.peekId3Data(input, id3FramePredicate, /* maxTagPeekBytes= */ 0)") [peekId3Data](https://developer.android.com/reference/androidx/media3/extractor/Id3Peeker#peekId3Data(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.metadata.id3.Id3Decoder.FramePredicate))( https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput input, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/Id3Decoder.FramePredicate id3FramePredicate )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/extractor/Id3Peeker#peekId3Data(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.metadata.id3.Id3Decoder.FramePredicate,int)` instead. <br /> |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/Metadata` | `https://developer.android.com/reference/androidx/media3/extractor/Id3Peeker#peekId3Data(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.metadata.id3.Id3Decoder.FramePredicate,int)( https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput input, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/Id3Decoder.FramePredicate id3FramePredicate, int maxTagPeekBytes )` Peeks ID3 data from the input and parses the first ID3 tag. |

## Public constructors

### Id3Peeker

```
public Id3Peeker()
```

## Public methods

### peekId3Data

```
@InlineMe(replacement = "this.peekId3Data(input, id3FramePredicate, /* maxTagPeekBytes= */ 0)")
public @Nullable Metadata [peekId3Data](https://developer.android.com/reference/androidx/media3/extractor/Id3Peeker#peekId3Data(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.metadata.id3.Id3Decoder.FramePredicate))(
    ExtractorInput input,
    @Nullable Id3Decoder.FramePredicate id3FramePredicate
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/extractor/Id3Peeker#peekId3Data(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.metadata.id3.Id3Decoder.FramePredicate,int)` instead.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` |   |

### peekId3Data

```
public @Nullable Metadata peekId3Data(
    ExtractorInput input,
    @Nullable Id3Decoder.FramePredicate id3FramePredicate,
    int maxTagPeekBytes
)
```

Peeks ID3 data from the input and parses the first ID3 tag.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput input` | The `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput` from which data should be peeked. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/Id3Decoder.FramePredicate id3FramePredicate` | Determines which ID3 frames are decoded. May be null to decode all frames. |
| `int maxTagPeekBytes` | The maximum number of bytes to peek when searching for each ID3 tag before giving up. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/Metadata` | The first ID3 tag decoded into a `https://developer.android.com/reference/androidx/media3/common/Metadata` object. May be null if ID3 tag is not present in the input. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | If an error occurred peeking from the input. |