/** * Format dispatch: the `decode` / `encode` entry points most callers use. * * ## Why the main entry points are async * * MP3 and FLAC carry large coefficient and Huffman tables. Statically importing * them here would pull that weight into every bundle, including ones that only * ever touch WAV. Instead they are loaded with a dynamic `import()`, which * bundlers turn into a separate chunk fetched only when a file of that type is * actually handled. * * That is what makes the async signature worth it: `decode()` on a WAV never * downloads the MP3 decoder. Synchronous {@link decodeSync} and * {@link encodeSync} are available for the built-in containers when a promise is * genuinely inconvenient. */ import { Audio } from './audio.js'; import type { WavEncodeOptions } from './formats/wav.js'; import type { AiffEncodeOptions } from './formats/aiff.js'; import type { ContainerEncodeOptions } from './formats/types.js'; import type { BinaryInput, DecodeOptions } from './types.js'; /** Normalises any accepted binary input to a `Uint8Array` without copying. */ export declare function toBytes(input: BinaryInput): Uint8Array; /** * Decodes any supported format into an {@link Audio}. * * ```ts * const audio = await decode(await file.arrayBuffer()); * ``` */ export declare function decode(input: BinaryInput, options?: DecodeOptions): Promise