/** * One sender's jitter buffer for the own transport (GRYT-1818). Sized from measured jitter, and it * drains back after a burst: the prototype's grew 51 → 155 ms without that, the reconnect bug's shape. */ import { type AudioPacket } from "./packet.js"; export type Pulled = { kind: "packet"; packet: AudioPacket; } | { kind: "lost"; } | { kind: "silence"; }; export interface JitterBufferOptions { frameMs: number; minMs?: number; maxMs?: number; } export declare class JitterBuffer { private readonly frameMs; private readonly minMs; private readonly maxMs; private readonly queue; private next; private playing; private concealed; private over; private transits; readonly stats: { late: number; duplicate: number; lost: number; drained: number; rebuffered: number; }; constructor({ frameMs, minMs, maxMs }: JitterBufferOptions); /** What arrival jitter asks for: its 95th percentile plus one frame, within min and max. */ get targetMs(): number; /** What's queued from the next frame to play to the newest that arrived. */ get depthMs(): number; push(packet: AudioPacket, arrivalMs: number): void; /** Called once a frame by the player. */ pull(): Pulled; }