Id3AudioWriter

data class Id3AudioWriter @JvmOverloads constructor(var padding: Int = 4096)

Builder for ID3 v2.3 tags.

Note: Current is impossible to delete a tag frame after set it. If you need to do that, create a Id3AudioWriter.deepCopy before and modify it, or only don't set the value.

Don't recommend to call Id3AudioWriter.addTag or Id3AudioWriter.toByteArray or Id3AudioWriter.build repeated.

Example:

val writer = Id3AudioWriter()
writer[Id3v2v3TagFrame.TPE1] = listOf("Eminem", "50 Cent")
val tag = writer.addTag()

Java:

class Id3BuilderJavaTest {
void testId3Writer() {
final var writer = new Id3AudioWriter();
writer.setPadding(0);
// Need to call `.INSTANCE` because is an kotlin object.
writer.set(Id3v2v3TagFrame.TIT2.INSTANCE, "Title");
writer.set(Id3v2v3TagFrame.TPE1.INSTANCE, List.of("Eminem", "50 Cent"));
final byte[] tag = writer.build();
}
}

See also

Constructors

Link copied to clipboard
constructor(padding: Int = 4096)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Padding to add to the end of the file.

Functions

Link copied to clipboard

Build the tag and add it to a new ByteArray.

Link copied to clipboard

Build the tag and add it to a new ByteArray.

Link copied to clipboard
fun deepCopy(padding: Int = this.padding): Id3AudioWriter

Deep copy of the current Id3AudioWriter. Include all frames previously added with Id3AudioWriter.set

Link copied to clipboard

implies (id == APIC)

implies (id == COMM)

operator fun set(id: Id3v2v3TagFrame.IntegerTagFrame, value: Int)

implies (id == TBPM || id == TLEN || id == TYER)

implies (id == TCOM || id == TCON || id == TPE1)

implies (id == IPLS)

operator fun set(tag: Id3v2v3TagFrame.PrivateTagFrame, id: String, value: ByteArray)

implies (id == PRIV)

implies (id == SYLT)

operator fun set(id: Id3v2v3TagFrame.TextTagFrame, value: String)
operator fun set(id: Id3v2v3TagFrame.UnsynchronisedLyricsTagFrame, lyrics: String, description: String, language: String)

implies (id == USLT)

operator fun set(id: Id3v2v3TagFrame.UserDefinedTextTagFrame, description: String, value: String)

implies (id == TXXX)

implies (id == WXXX) where UserDefinedText.value is a link.

operator fun set(id: Id3v2v3TagFrame.UserDefinedUrlTagFrame, description: String, value: String)

implies (id == WXXX)

operator fun set(frameName: String, value: FrameValue)

Advanced set frame as string

operator fun set(types: List<Id3v2v3TagFrame>, values: List<FrameValue>)

Set various frames of varios type Id3v2v3TagFrame to values

Link copied to clipboard

Build the tag and add it to a new ByteArray.