/** * Format detection by magic bytes. * * Never trust a file extension — uploads are routinely mislabelled, and a * `.wav` that is really an MP3 is common enough that content sniffing is the * only reliable path. * * Formats audiobox cannot decode are still *detected*, so the error can say * "this is an Ogg file, which audiobox doesn't read" instead of the useless * "unrecognised data". Knowing what you handed over is most of the debugging. */ import type { AudioFormat } from '../types.js'; /** A container audiobox recognises but does not decode. */ export type KnownUndecodableFormat = 'ogg' | 'mp4' | 'webm' | 'wavpack' | 'ape' | 'musepack' | 'amr' | 'midi'; export type SniffResult = { kind: 'supported'; format: AudioFormat; } | { kind: 'unsupported'; format: KnownUndecodableFormat; label: string; } | { kind: 'unknown'; }; /** Identifies the container in `input` from its leading bytes. */ export declare function sniff(input: Uint8Array): SniffResult; //# sourceMappingURL=sniff.d.ts.map