"use client"; import { useCallback, useEffect, useRef, useState } from "react"; import { MUTE_FADE, START_LEAD, bufferSchedule, covers, decodeSpan, elementShouldStop, muteRamp, playheadAt, } from "@/lib/report/playback.mjs"; import { timeStretch, wantsStretch } from "@/lib/report/timeStretch.mjs"; import { GAP_FADE, gapsWithin, inGap, keptSpans } from "umtool-report-to-video/gaps"; import type { BenchMedia, Span } from "./benchMedia"; // --------------------------------------------------------------------------- // THE BENCH'S PLAYBACK ENGINE, shared by the clip bench and the reel's walk // (lifted out of ClipBench.tsx unchanged in behaviour; lane/reel-bench). // // EVERY BOUNDED RANGE PLAYS FROM DECODED AUDIO. A selection, an edge, a line // of the transcript, the auto-audition: each is an AudioBufferSourceNode // started at an exact offset and stopped at an exact time on the audio // clock, so what you hear ends where the selection ends, to the sample. The //