/** @packageDocumentation ID3v1 tag implementation. Reads and writes the fixed 128-byte ID3v1 tag block. */ import { ByteVector } from "../../byteVector.js"; import { Tag } from "../../tag.js"; import { IOStream } from "../../toolkit/ioStream.js"; import type { offset_t } from "../../toolkit/types.js"; /** * 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. */ export declare class ID3v1Tag extends Tag { /** The track title. */ private _title; /** The lead artist or performer. */ private _artist; /** The album or collection name. */ private _album; /** The release year stored as a 4-character Latin1 string. */ private _year; /** Free-form comment text. */ private _comment; /** The track number within the album (0 if unset). */ private _track; /** The genre index into the ID3v1 genre table (255 = unknown). */ private _genre; /** Creates a new, empty ID3v1Tag. */ constructor(); /** * 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`. */ static readFrom(stream: IOStream, tagOffset: offset_t): Promise; /** Gets the track title. */ get title(): string; /** Sets the track title. */ set title(value: string); /** Gets the lead artist or performer. */ get artist(): string; /** Sets the lead artist or performer. */ set artist(value: string); /** Gets the album or collection name. */ get album(): string; /** Sets the album or collection name. */ set album(value: string); /** Gets the free-form comment text. */ get comment(): string; /** Sets the free-form comment text. */ set comment(value: string); /** Gets the genre name resolved from the stored genre index. */ get genre(): string; /** * Sets the genre by name. Supports ID3v2-style numeric references such as * `"(17)"`. Unrecognised names are stored as index 255 (unknown). */ set genre(value: string); /** Gets the release year, or 0 if unset or unparseable. */ get year(): number; /** Sets the release year. A value ≤ 0 clears the field. */ set year(value: number); /** Gets the track number within the album (0 if unset). */ get track(): number; /** Sets the track number, clamped to the range 0–255. */ set track(value: number); /** Gets the raw numeric genre index (0–254, or 255 for unknown). */ get genreNumber(): number; /** Sets the raw numeric genre index, clamped to the range 0–255. */ set genreNumber(value: number); /** Returns the "TAG" file identifier as a ByteVector. */ static fileIdentifier(): ByteVector; /** Render the tag as a 128-byte ByteVector. */ render(): ByteVector; /** * Parses a raw 128-byte ID3v1 tag buffer, populating all tag fields. * @param data - Raw 128-byte tag buffer including the "TAG" identifier. */ private parse; /** * Strips null bytes and trailing whitespace from a fixed-length Latin1 string field. * @param data - The raw fixed-length string field. * @returns The trimmed string. */ private parseString; } //# sourceMappingURL=id3v1Tag.d.ts.map