/** * @packageDocumentation Format detection utilities for mapping file extensions and magic bytes * to taglib-ts format keys. This module has no imports of format-specific * classes to enable tree-shaking and code splitting. */ import { IOStream } from "./toolkit/ioStream.js"; /** * Determine the audio format from a filename extension. * * @param name A filename or path whose extension is used for detection * (e.g. `"track.mp3"` or `"/music/song.flac"`). * @returns A format key string (e.g. `"mpeg"`, `"flac"`), or `null` when the * extension is not recognised. */ export declare function detectByExtension(name: string): string | null; /** * Determine the audio format by inspecting magic bytes in the stream. * * Reads up to the first 36 bytes (and occasionally seeks further for formats * such as S3M and MOD). MPEG is matched last because its frame-sync bytes * (`0xff 0xe*`) are prone to false positives. * * @param stream The audio data stream, seeked to any position on entry. * @returns A format key string, or `null` when the format cannot be identified. */ export declare function detectByContent(stream: IOStream): Promise; /** * Detect the Ogg sub-format (Vorbis, Opus, Speex, or FLAC) by scanning the * first 128 bytes of a stream already identified as Ogg. * * @param stream The Ogg audio data stream. * @returns One of `"ogg-opus"`, `"ogg-speex"`, `"ogg-flac"`, or `"ogg-vorbis"` * (the last is used as a fallback when none of the others match). */ export declare function detectOggSubFormat(stream: IOStream): Promise; /** * Return the full list of file extensions supported by taglib-ts. * * @returns An array of lowercase extension strings without a leading dot. */ export declare function defaultFileExtensions(): string[]; //# sourceMappingURL=formatDetection.d.ts.map