taglib-ts
    Preparing search index...

    ID3v1 tag implementation.

    ID3v1 is a fixed 128-byte tag appended to the end of an MP3 file. Field lengths are fixed and strings are Latin1-encoded.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get album(): string

      Gets the album or collection name.

      Returns string

    • set album(value: string): void

      Sets the album or collection name.

      Parameters

      • value: string

      Returns void

    • get artist(): string

      Gets the lead artist or performer.

      Returns string

    • set artist(value: string): void

      Sets the lead artist or performer.

      Parameters

      • value: string

      Returns void

    • get comment(): string

      Gets the free-form comment text.

      Returns string

    • set comment(value: string): void

      Sets the free-form comment text.

      Parameters

      • value: string

      Returns void

    • get genre(): string

      Gets the genre name resolved from the stored genre index.

      Returns string

    • set genre(value: string): void

      Sets the genre by name. Supports ID3v2-style numeric references such as "(17)". Unrecognised names are stored as index 255 (unknown).

      Parameters

      • value: string

      Returns void

    • get genreNumber(): number

      Gets the raw numeric genre index (0–254, or 255 for unknown).

      Returns number

    • set genreNumber(value: number): void

      Sets the raw numeric genre index, clamped to the range 0–255.

      Parameters

      • value: number

      Returns void

    • get isEmpty(): boolean

      True when every field is empty / zero.

      Returns boolean

    • get title(): string

      Gets the track title.

      Returns string

    • set title(value: string): void

      Sets the track title.

      Parameters

      • value: string

      Returns void

    • get track(): number

      Gets the track number within the album (0 if unset).

      Returns number

    • set track(value: number): void

      Sets the track number, clamped to the range 0–255.

      Parameters

      • value: number

      Returns void

    • get year(): number

      Gets the release year, or 0 if unset or unparseable.

      Returns number

    • set year(value: number): void

      Sets the release year. A value ≤ 0 clears the field.

      Parameters

      • value: number

      Returns void

    Methods

    • Return all complex property values for the given key.

      Parameters

      • _key: string

        The property key (e.g. "PICTURE").

      Returns VariantMap[]

      An array of VariantMap objects, or an empty array if the key is not present.

    • Return the keys of all complex (non-string) properties stored in this tag. Complex properties include embedded pictures and similar structured data.

      Returns string[]

      An array of property key strings, or an empty array if none.

    • Remove properties that are not supported by this tag format. The default implementation is a no-op; subclasses may override.

      Parameters

      • _properties: string[]

        Keys of the properties to remove.

      Returns void

    • Set complex property values for the given key, replacing any existing values.

      Parameters

      • _key: string

        The property key (e.g. "PICTURE").

      • _value: VariantMap[]

        The new values to store.

      Returns boolean

      true if the property was stored, false if the format does not support complex properties.

    • Copy tag fields from source to target. When overwrite is false, only empty fields in the target are filled in.

      Parameters

      • source: Tag

        The tag to copy values from.

      • target: Tag

        The tag to copy values into.

      • overwrite: boolean

        When true, all fields in target are overwritten; when false, only unset fields are populated.

      Returns void

    • Join an array of tag values with " / ".

      Parameters

      • values: string[]

        The string values to join.

      Returns string

      A single string with values separated by " / ".

    • Asynchronously read and parse an ID3v1 tag from the given stream at the specified offset. The offset should point to the first byte of the 128-byte tag (i.e. the "T" in "TAG"). Returns a Promise<ID3v1Tag>.

      Parameters

      Returns Promise<ID3v1Tag>