export declare function buildRmsEnvelope(samples: Int16Array, windowSize?: number, hopSize?: number): number[]; export declare function compareAudioEnvelopes(rendered: number[], snapshot: number[], maxLagWindows: number): { correlation: number; lagWindows: number; }; /** * Result of {@link computeAudioResidualRmsDb}. * * `overallDb` is the residual Overall RMS reading from astats. For * exact-cancellation (truly identical streams), ffmpeg returns `-inf`; * this helper normalizes that to `Number.NEGATIVE_INFINITY` so callers * don't have to special-case the literal string. */ export interface AudioResidualRms { overallDb: number; ok: boolean; /** Raw stderr lines that mention `RMS level` (one per channel + overall). Useful for debugging unexpected drift. */ rmsLines: string[]; /** * Diagnostic when the helper could not produce a residual reading * (ffmpeg missing, ffprobe duration mismatch, astats output unparseable, * etc.). When set, callers should treat it as a hard failure even though * `overallDb` may be `NaN`. */ error?: string; } /** * Compute the residual Overall RMS (dBFS) of `rendered - snapshot`. * * Both inputs are paths to media files containing an audio stream. * They're resampled to 48 kHz stereo, the snapshot is phase-inverted, * the two are summed via `amix`, and `astats` reports the residual * level. * * Returns `{ ok: false, overallDb: NaN }` if either input lacks an * audio stream, or if ffmpeg's output didn't contain a parseable RMS * line — the caller decides whether that's a pass (no-audio fixture) * or a fail (audio expected but missing). * * `maxResidualRmsDb` defaults to `-50`. Pass `-Infinity` * to compute the value without gating it. */ export declare function computeAudioResidualRmsDb(rendered: string, snapshot: string, maxResidualRmsDb?: number): AudioResidualRms; //# sourceMappingURL=audioRegression.d.ts.map