@UnstableApi
class Id3Decoder : SimpleMetadataDecoder


Decodes ID3 tags.

Summary

Nested types

A predicate for determining whether individual frames should be decoded.

Constants

const Int

Length of an ID3 tag header.

const Int
ID3_TAG = 4801587

The first three bytes of a well formed ID3 tag header.

const Id3Decoder.FramePredicate!

A predicate that indicates no frames should be decoded.

Public constructors

Public functions

Metadata?
decode(data: ByteArray!, size: Int)

Decodes ID3 tags.

Protected functions

Metadata?
decode(inputBuffer: MetadataInputBuffer!, buffer: ByteBuffer!)

Called by decode after input buffer validation has been performed.

Inherited functions

From androidx.media3.extractor.metadata.SimpleMetadataDecoder
Metadata?
decode(inputBuffer: MetadataInputBuffer!)

Decodes a Metadata element from the provided input buffer.

Constants

ID3_HEADER_LENGTH

const val ID3_HEADER_LENGTH = 10: Int

Length of an ID3 tag header.

ID3_TAG

const val ID3_TAG = 4801587: Int

The first three bytes of a well formed ID3 tag header.

NO_FRAMES_PREDICATE

const val NO_FRAMES_PREDICATEId3Decoder.FramePredicate!

A predicate that indicates no frames should be decoded.

Public constructors

Id3Decoder

Id3Decoder()

Id3Decoder

Id3Decoder(framePredicate: Id3Decoder.FramePredicate?)
Parameters
framePredicate: Id3Decoder.FramePredicate?

Determines which frames are decoded. May be null to decode all frames.

Public functions

decode

fun decode(data: ByteArray!, size: Int): Metadata?

Decodes ID3 tags.

Parameters
data: ByteArray!

The bytes to decode ID3 tags from.

size: Int

Amount of bytes in data to read.

Returns
Metadata?

A Metadata object containing the decoded ID3 tags, or null if the data could not be decoded.

Protected functions

decode

protected fun decode(inputBuffer: MetadataInputBuffer!, buffer: ByteBuffer!): Metadata?

Called by decode after input buffer validation has been performed.

Parameters
inputBuffer: MetadataInputBuffer!

The input buffer to decode.

buffer: ByteBuffer!

The input buffer's data buffer, for convenience. Validation by decode guarantees that hasArray, position and arrayOffset are true, 0 and 0 respectively.

Returns
Metadata?

The decoded metadata object, or null if the metadata could not be decoded.