import { WasmBindings } from "../wasm/bindings"; import { AudioTrack } from "../types"; /** * Browser-agnostic PCM frame. Avoids the WebCodecs AudioData constructor, * which Firefox on Android does not implement. */ export interface PCMFrame { planes: Float32Array[]; numberOfFrames: number; numberOfChannels: number; sampleRate: number; timestamp: number; } export declare class SoftwareAudioDecoder { private bindings; private onData; private onError; private isConfigured; private trackIndex; private _downmix; private consecutiveFailures; private isBroken; private static readonly MAX_CONSECUTIVE_FAILURES; private coalesceTarget; private pending; private pendingSamples; constructor(bindings: WasmBindings); setDownmix(downmix: boolean): void; setOnData(callback: (frame: PCMFrame) => void): void; setOnError(callback: (error: Error) => void): void; configure(track: AudioTrack): Promise; flush(): Promise; reset(): void; close(): void; decode(data: Uint8Array, timestamp: number, keyframe: boolean): void; private processDecodedFrame; /** * Coalesce tiny decoded frames (TrueHD/DTS emit ~40 samples each) into ~30ms * buffers before handing them to the renderer, so its per-frame scheduler * doesn't click on every boundary. Frames already at/above the target (AC-3, * E-AC-3, AAC in software) pass straight through with no added latency. */ private enqueueFrame; private flushPending; private mergePending; get configured(): boolean; } //# sourceMappingURL=SoftwareAudioDecoder.d.ts.map