mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 12:54:29 +00:00
applyAudioFxChain was 180 lines at 23 cyclomatic / 23 cognitive, most of it the CDP transfer: three chunked page.evaluate loops with the resource lease, the guards and the envelope bake threaded between them. The transfer is now four functions -- sendPlanesToPage, renderPlanesInPage, readPlaneFromPage / readPlanesFromPage, envelopeWalkerFor -- leaving applyAudioFxChain as the lease-and-lifecycle shell it is, at 11/7/62. Every chunking comment moved with the code it explains, including the two that matter most: why chunks stay separate byte arrays page-side, and why the output Buffer's byteOffset/byteLength are respected when viewing it as Float32Array. The helpers sit BELOW applyAudioFxChain on purpose -- fallow fingerprints a finding by line position, so inserting above it would re-flag the inherited complexity of everything further down the file. Engine's audioFx suite (16 tests) passes unchanged.