taglib-ts
    Preparing search index...

    Class ApeTag

    APE (APEv2) tag implementation.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get album(): string

      Album title stored in the "ALBUM" item.

      Returns string

    • set album(v: string): void

      Parameters

      • v: string

        New album string; empty string removes the item.

      Returns void

    • get artist(): string

      Lead artist/performer stored in the "ARTIST" item.

      Returns string

    • set artist(v: string): void

      Parameters

      • v: string

        New artist string; empty string removes the item.

      Returns void

    • get comment(): string

      User comment stored in the "COMMENT" item.

      Returns string

    • set comment(v: string): void

      Parameters

      • v: string

        New comment string; empty string removes the item.

      Returns void

    • get genre(): string

      Genre stored in the "GENRE" item.

      Returns string

    • set genre(v: string): void

      Parameters

      • v: string

        New genre string; empty string removes the item.

      Returns void

    • get isEmpty(): boolean

      An APE tag is empty when it contains no items.

      Returns boolean

    • get title(): string

      Track title stored in the "TITLE" item.

      Returns string

    • set title(v: string): void

      Parameters

      • v: string

        New title string; empty string removes the item.

      Returns void

    • get track(): number

      Track number, read from the "TRACK" item (falling back to "TRACKNUMBER"). Returns 0 when not set.

      Returns number

    • set track(v: number): void

      Parameters

      • v: number

        Track number, or 0 to remove the item. Any pre-existing "TRACKNUMBER" alias item is also removed.

      Returns void

    • get year(): number

      Release year, read from the "YEAR" item (falling back to "DATE"). Returns 0 when not set.

      Returns number

    • set year(v: number): void

      Parameters

      • v: number

        Four-digit year, or 0 to remove the item. Any pre-existing "DATE" alias item is also removed.

      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.

    • Returns a map of item key (upper-cased) to item, mirroring the C++ itemListMap().

      Returns Map<string, ApeItem>

      A Map from uppercased item key to the corresponding ApeItem.

    • Remove an item by key (case-insensitive).

      Parameters

      • key: string

      Returns void

    • 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 an APE tag from the given stream. offset points to the start of the 32-byte footer. Returns a Promise<ApeTag>.

      Parameters

      • stream: IOStream

        The stream to read from.

      • offset: number

        Byte offset of the 32-byte APE footer within stream.

      Returns Promise<ApeTag>

      A resolved promise containing the populated tag (may be empty on parse failure).