/** * Amplitudes for {@link TxVoiceClip}'s bars, decoded from the recording itself. * * Decoded once per URL and kept in a small LRU: a conversation re-renders its bubbles far more * often than it gains recordings, and every remount would otherwise fetch and decode the same * file again. The promise is cached, not the result, so two clips mounting on one URL share the * work. A failure is cached too — a `tfile:` that is gone stays gone — and drops out of the LRU * like any other entry. */ /** Buckets per decoded recording; resampled down (or up) to the bars that fit. */ export declare const PEAK_BUCKETS = 96; /** Recordings kept decoded. A long conversation evicts its oldest. */ export declare const PEAK_CACHE_SIZE = 24; /** * RMS per bucket, stretched so the quietest tenth of the recording reads as silence and the * loudest bucket as full height. Speech hovers well above zero between words — breath, room tone — * and on a plain 0–max scale every bar of a longer recording came out nearly as tall as the next. */ export declare function computePeaks(samples: Float32Array, buckets?: number): number[]; /** * `peaks` fitted to `bars` slots, each slot the mean of the values it covers (a slot narrower * than one value repeats it). The mean, not the loudest value: over half a second of speech the * loudest bucket is almost always a syllable, and taking it flattened every recording into a * block. Values are clamped to `0..1`; non-finite ones count as silence. */ export declare function resamplePeaks(peaks: readonly number[], bars: number): number[]; /** Scales bars so the tallest fills the height; all-silent bars stay flat. */ export declare function fillPeaks(bars: readonly number[]): number[]; export declare function canDecodeSource(src: string): boolean; /** The recording's amplitudes, or `null` when it cannot be fetched or decoded. */ export declare function loadPeaks(src: string): Promise; /** Test seam: forget every decoded recording. */ export declare function clearPeakCache(): void;