/** @packageDocumentation AIFF/AIFC file handler. Reads and writes ID3v2 tags embedded in AIFF/FORM containers. */ import { RiffFile } from "../riffFile.js"; import { AiffProperties } from "./aiffProperties.js"; import { Id3v2Tag } from "../../mpeg/id3v2/id3v2Tag.js"; import type { Tag } from "../../tag.js"; import type { ReadStyle } from "../../toolkit/types.js"; import type { IOStream } from "../../toolkit/ioStream.js"; /** * AIFF / AIFC file handler. * * AIFF is a big-endian RIFF-like container (`"FORM"` / `"AIFF"` or `"AIFC"`): * - `"COMM"` – common audio properties * - `"SSND"` – sound data * - `"ID3 "` / `"id3 "` – ID3v2 tag */ export declare class AiffFile extends RiffFile { /** Audio properties parsed from the `"COMM"` chunk, or `null` if not yet read. */ private _properties; /** ID3v2 tag read from the `"ID3 "` chunk, or `null` if absent. */ private _id3v2Tag; /** Whether an ID3v2 chunk was found on disk during parsing. */ private _hasId3v2Tag; /** * Private constructor — use {@link AiffFile.open} to create instances. * @param stream - The underlying I/O stream for the AIFF file. */ private constructor(); /** * Open and parse an AIFF file from the given stream. * @param stream - The I/O stream to read from. * @param readProperties - Whether to parse audio properties. Defaults to `true`. * @param readStyle - Level of detail for audio property parsing. * @returns A fully initialised `AiffFile` instance. */ static open(stream: IOStream, readProperties?: boolean, readStyle?: ReadStyle): Promise; /** * Returns the ID3v2 tag for this file. * @returns The {@link Id3v2Tag}, or `null` if not yet loaded. */ tag(): Tag | null; /** * Returns the audio properties parsed from the `"COMM"` chunk. * @returns The {@link AiffProperties}, or `null` if `readProperties` was `false` on open. */ audioProperties(): AiffProperties | null; /** * The ID3v2 tag embedded in the `"ID3 "` chunk, or `null` if absent. * @returns The {@link Id3v2Tag}, or `null`. */ get id3v2Tag(): Id3v2Tag | null; /** * Whether the file contained an ID3v2 chunk when it was opened. * @returns `true` if an `"ID3 "` chunk was found during parsing. */ get hasId3v2Tag(): boolean; /** * Writes all pending tag changes back to the underlying stream. * Matches C++ behavior: always removes all existing ID3 chunks first, * then re-appends a fresh `"ID3 "` chunk if the tag is non-empty. * @param version - Optional ID3v2 version to save as. * @returns `true` on success, `false` if the file is read-only. */ save(version?: number): Promise; /** * Reads all chunks and (optionally) audio properties from the parsed chunk list. * @param readProperties - Whether to parse audio properties. * @param readStyle - Level of detail for audio property parsing. */ private read; } //# sourceMappingURL=aiffFile.d.ts.map