mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-17 15:24:19 +00:00
`HTMLMediaElement.volume` is spec-clamped to [0,1], so both timeline probes lost a clip's authored gain the moment it also carried a fade: the probe seeded the element at the clamped value and every sample read back at or below 0 dB, and the mixer prefers probed keyframes over the static volume. Both probes now shadow the accessor for their own duration and forward the clamped value to the native setter, so the authored gain survives while nothing outside the probe ever sees an illegal volume. Measured on one 6 s composition, first 4 s: unity -32.8 LUFS, boosted -27.0, boosted-with-fade -32.8 before and -27.0 after — +5.8 dB, exactly the gain the clip was authored at. Collapse the other owners of the same decision, each of which kept preview and render disagreeing on their own: the Web Audio master gain had two writers, so unmuting discarded the user's volume; the user's volume was applied twice, once per clip and once on the master; and the control bridge wrote `el.volume` for clips the transport already owned, which the next tick read back as the clip's author gain. `<video data-has-audio>` is never scheduled as a buffer source, so it now routes through a media-element gain node — but only while the audio context is running, since routing into a suspended graph would silence audio the native path is playing.