/** * RIFF/WAVE reader and writer. * * Covers plain RIFF, RF64/BW64 (the 64-bit extension used for files above 4 GB), * `WAVE_FORMAT_EXTENSIBLE`, IEEE float, A-law, µ-law, and IMA ADPCM. * * WAV is a chunked format, and the chunk sizes are attacker-controlled. Every * size is validated against the bytes actually present before it is used, and * unrecognised chunks are skipped rather than trusted — a decoder that seeks * blindly to a declared offset is the classic way these parsers get exploited. */ import { type Limits } from '../limits.js'; import type { DecodedContainer, ContainerEncodeOptions } from './types.js'; export interface WavDecodeOptions { limits?: Partial; } /** Decodes a RIFF/WAVE, RF64, BW64, or Wave64 file. */ export declare function decodeWav(input: Uint8Array, options?: WavDecodeOptions): DecodedContainer; export interface WavEncodeOptions extends ContainerEncodeOptions { /** * Force `WAVE_FORMAT_EXTENSIBLE`. * * Written automatically above 2 channels or above 16 bits, where plain RIFF is * ambiguous about channel order. Rarely worth setting by hand. */ extensible?: boolean; } /** Encodes planar float channels as a RIFF/WAVE file. */ export declare function encodeWav(channelData: readonly Float32Array[], sampleRate: number, options?: WavEncodeOptions): Uint8Array;