Skip to content

fix(hyperframes-media): create the output dir for ElevenLabs TTS before writing#1960

Draft
miguel-heygen wants to merge 1 commit into
mainfrom
fix/tts-elevenlabs-mkdir-output-dir
Draft

fix(hyperframes-media): create the output dir for ElevenLabs TTS before writing#1960
miguel-heygen wants to merge 1 commit into
mainfrom
fix/tts-elevenlabs-mkdir-output-dir

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Root cause

synthesizeOne's elevenlabs branch spawns a Python helper that writes straight to wavAbs, but — unlike the heygen path (which mkdirs via transcodeToWav / directly) and the kokoro path (where the hyperframes tts CLI owns the output dir) — it never created the parent directory. On a fresh project with no assets/voice/ yet, the Python save failed and the line was silently dropped as "TTS failed - omitted", so every ElevenLabs line vanished until the user hand-created assets/voice.

Reported precisely (the reporter traced it to the missing mkdirSync(dirname(wavAbs)) that the other two providers have).

Fix

mkdirSync(dirname(wavAbs), { recursive: true }) before spawning, matching the other providers. One line; dirname/mkdirSync were already imported.

Test plan

New tts.test.mjs case drives synthesizeOne({ provider: "elevenlabs", … }) with a nested, not-yet-created wavAbs and asserts the output dir exists afterward — independent of whether the (keyless) Python actually writes a file, since the mkdir runs before the spawn either way.

node --test skills/hyperframes-media/scripts/lib/tts.test.mjs — 6/6 passing. node --check + oxlint/oxfmt clean; full bun run build clean.


From the same ~20h feedback backlog: PR #1959 (Windows symlink EPERM) got a 2nd independent confirmation, and several "spawn EINVAL" reports corroborate PR #1937 (ffmpeg .cmd-vs-.exe). Other precise items logged for follow-up: a Windows npx/npm_execpath silent-TTS-failure, a Lambda __dirname-in-ESM boot crash (build-zip.ts banner), and a static-dedup freeze for <template>-mounted sub-comps on a zero-tween host.

…re writing

synthesizeOne's elevenlabs branch spawns a Python helper that writes
straight to wavAbs, but — unlike the heygen path (which mkdirs via
transcodeToWav / directly) and the kokoro path (where the `hyperframes
tts` CLI owns the output dir) — it never created the parent directory.
On a fresh project with no assets/voice/ yet, the Python save failed and
the line was silently dropped as "TTS failed - omitted", so every
ElevenLabs line vanished until the user hand-created assets/voice.

Fix: mkdirSync(dirname(wavAbs), { recursive: true }) before spawning,
matching the other providers.

Test: new tts.test.mjs case drives synthesizeOne(elevenlabs) with a
nested, not-yet-created wavAbs and asserts the output dir exists
afterward — independent of whether the (keyless) Python actually writes
a file, since the mkdir runs before the spawn either way.
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