Skip to content

refactor(producer): delete the dead audioExtractor duplicate - #3389

Open
vanceingalls wants to merge 2 commits into
mainfrom
fix/audio-extractor-cjk-src
Open

refactor(producer): delete the dead audioExtractor duplicate#3389
vanceingalls wants to merge 2 commits into
mainfrom
fix/audio-extractor-cjk-src

Conversation

@vanceingalls

Copy link
Copy Markdown
Collaborator

Follow-up flagged in the PRINFRA-349 reviews (#2759): packages/producer/src/services/audioExtractor.ts resolved <audio> srcs with a hand-rolled startsWith("/") && startsWith("http") join — no percent-decode, no compiledDir, no Windows isAbsolute — the same shape the HDR video and image probes were just fixed for. A CJK audio filename (音频1.mp3) served percent-encoded reproduces the same silent miss.

Tracing it to fix it turned up the better answer: nothing calls this file. Its processAudio has no callers, and its parseAudioElements is shadowed everywhere that matters — audioMixer.ts is a pure re-export of the engine's, and renderMediaCollector.ts plus the playback-rate parity fixture import from @hyperframes/engine directly. The engine resolver already has decode + compiledDir + isAbsolute.

So the file was a second, silently diverging copy of an engine decision, and the CJK bug was one symptom of that. Deleting it fixes the symptom and removes the duplicate; patching it would have left a resolver nobody reaches.

Producer typecheck and the full producer suite pass with it gone.

🤖 Generated with Claude Code

`packages/producer/src/services/audioExtractor.ts` defined its own
`parseAudioElements` and a `processAudio` that nothing calls. Every live
consumer — `audioMixer.ts` (a pure re-export), `renderMediaCollector.ts`, the
playback-rate parity fixture — imports these from `@hyperframes/engine`
instead, so the file was a second, silently diverging copy of an engine
decision.

That divergence was already a bug: PRINFRA-349's review flagged this file's
hand-rolled `startsWith("/")` source-path join as the same percent-encoded-CJK
failure fixed in the HDR probes, with no decode, no compiledDir and no Windows
`isAbsolute`. Engine's resolver has all three. Deleting the copy is the fix —
patching it would have kept a resolver nobody reaches.
`check-no-main-deletions.mjs` fails any branch that removes a file main has,
by design — the guard has no blanket escape hatch, so an intended removal is a
named, reviewable line. This adds that line with the reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant