/** @packageDocumentation Shorten (.shn) lossless audio file format handler. Read-only; decodes audio properties from the embedded verbatim header. */ import { File } from "../file.js"; import { Tag } from "../tag.js"; import { ReadStyle } from "../toolkit/types.js"; import type { IOStream } from "../toolkit/ioStream.js"; import { ShortenProperties } from "./shortenProperties.js"; /** * Shorten (.shn) file format handler. * * Read-only format. The file starts with the four-byte magic "ajkg", followed * by a version byte and variable-length coded audio parameters. The actual * audio metadata (sample rate, bits per sample) comes from an embedded WAVE * or AIFF header inside the first verbatim section. */ export declare class ShortenFile extends File { /** The stub tag (Shorten files carry no metadata). */ private _tag; /** Parsed audio properties, or `null` if not yet read. */ private _properties; /** * Private constructor — use {@link ShortenFile.open} to create instances. * @param stream - The underlying I/O stream for this Shorten file. */ private constructor(); /** * Opens and parses a Shorten file from the given stream. * @param stream - Readable I/O stream for the `.shn` file. * @param readProperties - When `true` (default), parse audio properties. * @param readStyle - Controls parsing accuracy vs. speed trade-off. * @returns A fully initialised `ShortenFile` instance. */ static open(stream: IOStream, readProperties?: boolean, readStyle?: ReadStyle): Promise; /** * Quick-check whether `stream` looks like a valid Shorten file. * Verifies the four-byte "ajkg" magic at offset 0. * @param stream - The I/O stream to test. * @returns `true` if the stream appears to be a valid Shorten file. */ static isSupported(stream: IOStream): Promise; /** * Returns the tag for this Shorten file. * Shorten files carry no metadata; the returned tag is always empty. * @returns The stub {@link ShortenTag}. */ tag(): Tag; /** * Returns the audio properties parsed from the Shorten stream. * @returns The {@link ShortenProperties}, or `null` if parsing failed or was skipped. */ audioProperties(): ShortenProperties | null; /** * Shorten files are read-only; this method always returns `false`. * @returns `false`. */ save(): Promise; /** * Reads and decodes audio properties from the Shorten stream header. * @param _readProperties - Ignored; properties are always parsed when the file is valid. * @param readStyle - Level of detail for audio property parsing. */ private read; /** * Parses a RIFF/WAVE header embedded in the Shorten verbatim section. * Extracts sample rate, bits per sample, and (if available) sample frame count. * @param header - The verbatim header bytes as a `ByteVector`. * @param props - The property values object to populate. */ private parseWaveHeader; /** * Parses an AIFF/AIFC header embedded in the Shorten verbatim section. * Extracts sample rate, bits per sample, and sample frame count from the COMM chunk. * @param header - The verbatim header bytes as a `ByteVector`. * @param props - The property values object to populate. */ private parseAiffHeader; } //# sourceMappingURL=shortenFile.d.ts.map