decklight 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/NOTICE +2 -0
  2. package/PLATFORM.md +61 -3
  3. package/README.md +58 -28
  4. package/SPEC.md +1326 -85
  5. package/cli/agent-review.mjs +5 -4
  6. package/cli/agents.mjs +148 -18
  7. package/cli/bundle-audio.mjs +10 -3
  8. package/cli/bundle-module.mjs +95 -0
  9. package/cli/bundle.mjs +125 -7
  10. package/cli/cast.mjs +86 -19
  11. package/cli/check-fixes.mjs +194 -0
  12. package/cli/check-watch.mjs +151 -0
  13. package/cli/check.mjs +491 -75
  14. package/cli/code-editor.mjs +287 -0
  15. package/cli/commands.mjs +13 -2
  16. package/cli/commit-flow.mjs +7 -3
  17. package/cli/commit-message.mjs +35 -8
  18. package/cli/commit-split.mjs +125 -25
  19. package/cli/deck-refs.mjs +8 -3
  20. package/cli/decklight.mjs +11 -1
  21. package/cli/design-system-edit.mjs +37 -1
  22. package/cli/design-system-refs.mjs +263 -6
  23. package/cli/design-system.mjs +82 -14
  24. package/cli/edit-address.mjs +184 -0
  25. package/cli/edit-git.mjs +23 -6
  26. package/cli/edit-handover.mjs +257 -40
  27. package/cli/edit-look.mjs +293 -6
  28. package/cli/edit-open.mjs +143 -0
  29. package/cli/edit-slides.mjs +1043 -67
  30. package/cli/edit-translate.mjs +243 -0
  31. package/cli/edit.mjs +3680 -319
  32. package/cli/editor-support.mjs +286 -0
  33. package/cli/enhance.mjs +157 -27
  34. package/cli/find-replace.mjs +142 -0
  35. package/cli/fix-review.mjs +368 -0
  36. package/cli/git.mjs +13 -0
  37. package/cli/init.mjs +101 -22
  38. package/cli/keep-awake.mjs +68 -0
  39. package/cli/marketplace-autocheck.mjs +200 -0
  40. package/cli/marketplace.mjs +250 -13
  41. package/cli/migrate-writing.mjs +214 -0
  42. package/cli/narrate.mjs +121 -5
  43. package/cli/open.mjs +53 -15
  44. package/cli/outside-edit.mjs +257 -0
  45. package/cli/paste.mjs +92 -0
  46. package/cli/pdf.mjs +88 -10
  47. package/cli/pptx-export.mjs +10 -5
  48. package/cli/publish.mjs +24 -3
  49. package/cli/record.mjs +86 -15
  50. package/cli/remote.mjs +32 -6
  51. package/cli/rewrite.mjs +265 -0
  52. package/cli/runtime-link.mjs +218 -17
  53. package/cli/serve.mjs +9 -6
  54. package/cli/setup.mjs +2 -2
  55. package/cli/skill-content.mjs +251 -10
  56. package/cli/skills/slide-writing.md +333 -0
  57. package/cli/skills/voiceover.md +423 -0
  58. package/cli/skills.mjs +282 -15
  59. package/cli/starter-full.mjs +353 -0
  60. package/cli/supervise.mjs +14 -0
  61. package/cli/theme-refs.mjs +14 -2
  62. package/cli/theme.mjs +3 -2
  63. package/cli/translate-core.mjs +466 -0
  64. package/cli/translate-files.mjs +149 -0
  65. package/cli/translate.mjs +458 -0
  66. package/cli/units.mjs +75 -7
  67. package/cli/util.mjs +25 -0
  68. package/cli/vocabulary-docs.mjs +138 -0
  69. package/dist/decklight.css +2506 -113
  70. package/dist/decklight.js +385 -175
  71. package/dist/decklight.js.map +4 -4
  72. package/docs/GLOSSARY.md +9 -2
  73. package/docs/WRITING_RESEARCH.md +327 -0
  74. package/package.json +5 -3
  75. package/themes/coastal.css +3 -0
  76. package/themes/metropolis.css +2 -0
  77. package/themes/reveal-blood.css +3 -0
  78. package/themes/reveal-league.css +2 -0
  79. package/themes/reveal-moon.css +2 -0
  80. package/themes/reveal-serif.css +1 -0
  81. package/themes/reveal-sky.css +1 -0
  82. package/themes/reveal-solarized.css +4 -0
  83. package/tools/brand-palette.mjs +6 -1
  84. package/tools/build-groups.mjs +28 -8
  85. package/tools/cdp.mjs +176 -0
  86. package/tools/chart-spec.mjs +242 -0
  87. package/tools/click-match.mjs +70 -0
  88. package/tools/code-options.mjs +174 -0
  89. package/tools/conversation.mjs +49 -0
  90. package/tools/deck-family.mjs +101 -0
  91. package/tools/deck-html.mjs +212 -15
  92. package/tools/design-system-format.mjs +40 -1
  93. package/tools/design-system-migrations.mjs +207 -0
  94. package/tools/diagram-shapes.mjs +221 -0
  95. package/tools/elevenlabs-tts.mjs +62 -53
  96. package/tools/exec.mjs +10 -2
  97. package/tools/face-clip.mjs +96 -0
  98. package/tools/face-layout.mjs +94 -0
  99. package/tools/gemini-tts.mjs +1 -1
  100. package/tools/invisible-in-print.mjs +27 -0
  101. package/tools/lipsync-auto.mjs +197 -0
  102. package/tools/lipsync-config.mjs +16 -0
  103. package/tools/lipsync-engines.mjs +22 -4
  104. package/tools/lipsync-server.mjs +8 -5
  105. package/tools/lipsync.mjs +122 -30
  106. package/tools/local-voice.mjs +1 -1
  107. package/tools/mouth-file.mjs +26 -0
  108. package/tools/mouth.mjs +320 -0
  109. package/tools/narration-manifest.mjs +100 -6
  110. package/tools/narration-synth.mjs +96 -76
  111. package/tools/recording-impact.mjs +16 -1
  112. package/tools/sentences.mjs +7 -1
  113. package/tools/site-clip.mjs +114 -0
  114. package/tools/starters.mjs +402 -0
  115. package/tools/steps.mjs +118 -0
  116. package/tools/take-check.mjs +146 -0
  117. package/tools/template-theme.mjs +3 -1
  118. package/tools/test-impact.mjs +36 -12
  119. package/tools/theme-check.mjs +196 -1
  120. package/tools/tone-cue.mjs +108 -0
  121. package/tools/tts-cache.mjs +9 -3
  122. package/tools/tts-engines.mjs +100 -11
  123. package/tools/video-cache.mjs +93 -0
  124. package/tools/video-live.mjs +349 -0
  125. package/tools/video-options.mjs +11 -0
  126. package/tools/video.mjs +825 -117
  127. package/tools/viseme-fit.mjs +27 -0
  128. package/tools/viseme-match.mjs +77 -0
  129. package/tools/vocabulary.mjs +397 -0
  130. package/tools/voice-renumber.mjs +605 -0
  131. package/tools/voiceover-server.mjs +42 -11
  132. package/tools/voiceover.mjs +48 -20
  133. package/dist/build-info.json +0 -1
@@ -7,6 +7,7 @@
7
7
  // credentials (nor run piper), so this process holds them and exposes:
8
8
  //
9
9
  // GET /ping → { ok, engine, model, voices, stylable, audioTags } (player probes)
10
+ // GET /voice → resolved voice identity, or the roster with ?roster=1
10
11
  // GET /voices → [[name, flavor], …]
11
12
  // POST /tts → audio/wav { text, voice, style }
12
13
  //
@@ -42,6 +43,7 @@ import { createInterface } from 'node:readline/promises';
42
43
  import { canBind, resolvePortConflict, describePortOutcome } from '../cli/port-conflict.mjs';
43
44
  import { execFile } from 'node:child_process';
44
45
  import { cacheHome, clipKey, createTtsCache, extFor } from './tts-cache.mjs';
46
+ import { checkedSynth, takeLine } from './take-check.mjs';
45
47
 
46
48
  /**
47
49
  * The one exec a deck may trigger: open macOS's voice-download pane.
@@ -63,7 +65,7 @@ export function openVoiceSettings(exec = execFile, platform = process.platform)
63
65
  }
64
66
  exec('open', [VOICE_SETTINGS_URI], () => { /* fire and forget — Settings owns the rest */ });
65
67
  }
66
- import { resolveEngine, engineBlocker, engineMenu, engineStatus, ENGINES } from './tts-engines.mjs';
68
+ import { resolveEngine, engineBlocker, engineMenu, engineStatus, ENGINES, listVoiceIdentities, resolveTtsVoice } from './tts-engines.mjs';
67
69
  import { loadTtsConfig, runSetupWizard, ttsConfigPath } from './tts-setup.mjs';
68
70
  import { argReader, isMain, parsePort, badPort } from './args.mjs';
69
71
  import { corsHeaders, readBody } from './bridge.mjs';
@@ -116,15 +118,17 @@ export async function ttsMain(args) {
116
118
  piper local neural TTS — offline, unlimited, no credentials, no cost.
117
119
  elevenlabs your ElevenLabs account's own voices — the ones you cloned included, listed
118
120
  first in the picker. Needs $ELEVENLABS_API_KEY (never written to disk).
119
- --tts-model eleven_v4 (default) reads a script's audio tags ([whispers],
121
+ --tts-model eleven_v4_turbo (default) reads a script's audio tags ([whispers],
120
122
  [laughs], [long pause]) as direction, and the picker's tone step appears
121
- for it / eleven_v4_turbo for latency / eleven_v3, the first tag model —
123
+ for it / eleven_v4 for quality over latency / eleven_v3, the first tag model —
122
124
  higher latency, more variable / eleven_multilingual_v2, no tags (a tag
123
125
  in the notes is taken out rather than read aloud).
124
- --tts-stability creative|natural|robust — how hard v3 follows a tag (v3 only;
125
- refused on any other model rather than silently doing nothing).
126
+ --tts-stability creative|natural|robust — how hard v3/v4 follow a tag, for
127
+ every sentence (refused on any other model rather than silently doing
128
+ nothing). Unset, a sentence under 60 characters goes at robust: short
129
+ input is where these models stutter.
126
130
  --tts-format mp3 if your plan has no PCM output (costs you the panel's
127
- Record this deck… and lip-sync, both of which read WAV).
131
+ Save with the deck and lip-sync, both of which read WAV).
128
132
 
129
133
  <installed> any engine from a marketplace (decklight library add engine <name>) — --engine
130
134
  takes its name like any of the six above, and the picker treats it the same.
@@ -285,6 +289,9 @@ export async function ttsMain(args) {
285
289
  // ElevenLabs v3/v4 act on [whispers]-style tags; for any other engine
286
290
  // the player (and /tts) take them out rather than have them read aloud
287
291
  audioTags: h.engine.audioTags === true,
292
+ // the language the engine is told with every sentence, when it is told
293
+ // one: the panel says so beside the voice, and says when it is not
294
+ ...(h.engine.lang ? { lang: h.engine.lang } : {}),
288
295
  // the engine's standing note — for `say` with no Siri voice this is
289
296
  // the download hint, and the picker keys its install row off it
290
297
  ...(h.engine.caveat ? { caveat: h.engine.caveat } : {}),
@@ -327,7 +334,7 @@ export async function ttsMain(args) {
327
334
  });
328
335
 
329
336
  // the player reads the cost estimate for its debug window
330
- const CORS = corsHeaders('x-tts-cost, x-tts-tokens, x-tts-cached');
337
+ const CORS = corsHeaders('x-tts-cost, x-tts-tokens, x-tts-cached, x-tts-take');
331
338
  let totalCost = 0;
332
339
  let totalChars = 0;
333
340
 
@@ -428,13 +435,29 @@ export async function ttsMain(args) {
428
435
  return sendJson(res, 200, { ok: true, ...added, voices: await voiceRoster(h) });
429
436
  } catch (e) { return e?.status ? sendJson(res, e.status, e.body) : sendJson(res, 502, { ok: false, error: String(e.message ?? e) }); }
430
437
  }
438
+ if (req.method === 'GET' && url.pathname === '/tts/voice') {
439
+ try {
440
+ const { engine, refIds } = await engineFor(asked);
441
+ if (url.searchParams.has('roster')) {
442
+ return sendJson(res, 200, { voices: await listVoiceIdentities(engine, { refresh: true }) });
443
+ }
444
+ const voice = url.searchParams.get('voice');
445
+ const voiceId = url.searchParams.get('voiceId') || refIds.get(voice);
446
+ const picked = await resolveTtsVoice(engine, { voice, voiceId, refresh: true });
447
+ return sendJson(res, 200, {
448
+ voice: picked.name, voiceId: picked.id, engine: engine.name, model: engine.model, audioTags: engine.audioTags === true,
449
+ });
450
+ } catch (e) {
451
+ return e?.status ? sendJson(res, e.status, e.body) : sendJson(res, 502, { error: e.message });
452
+ }
453
+ }
431
454
  if (req.method === 'GET' && url.pathname === '/tts/voices') {
432
455
  try { return sendJson(res, 200, await voiceRoster(await engineFor(asked))); }
433
456
  catch (e) { return e?.status ? sendJson(res, e.status, e.body) : sendJson(res, 500, { ok: false, error: String(e) }); }
434
457
  }
435
458
  if (req.method === 'POST' && url.pathname === '/tts') {
436
459
  try {
437
- const { text: said, voice: picked, style, engine: wanted } = JSON.parse((await readBody(req)).toString());
460
+ const { text: said, voice: picked, voiceId: requestedId, style, engine: wanted } = JSON.parse((await readBody(req)).toString());
438
461
  // the engine THIS tab speaks with — never whichever another tab last chose
439
462
  let h;
440
463
  try { h = await engineFor(wanted || asked); }
@@ -444,12 +467,14 @@ export async function ttsMain(args) {
444
467
  // never read aloud by one that cannot (SPEC `PRESENTING`)
445
468
  const text = forEngine(engine, said);
446
469
  if (!text?.trim()) { res.writeHead(400, CORS); return res.end('no text'); }
447
- const voice = refIds.get(picked) ?? picked;
470
+ const { request: voice, id } = await resolveTtsVoice(engine, {
471
+ voice: picked, voiceId: requestedId ?? refIds.get(picked),
472
+ });
448
473
  // The key is the SAME function `decklight narrate` hashes with, and
449
474
  // that is the point: a sentence previewed here and then batch-recorded
450
475
  // is one synthesis, not two identical bills (SPEC `NARRATION`).
451
476
  const ext = extFor(engine.synth.mimeType ?? 'audio/wav');
452
- const key = clipKey(engine, { voice, style, text });
477
+ const key = clipKey(engine, { voice: id ?? voice, style, text });
453
478
  let fresh = !cache.has(key);
454
479
  if (fresh) {
455
480
  const bytes = disk.read(key, ext);
@@ -462,7 +487,9 @@ export async function ttsMain(args) {
462
487
  if (fresh) {
463
488
  process.stdout.write(` ${engine.name} ${picked}: ${text.length} chars … `);
464
489
  const t0 = Date.now();
465
- cache.set(key, await engine.synth(text, { voice, style }));
490
+ // a take whose length does not fit its text is sampled once more
491
+ // before it is cached, and played on every pass after (#1005)
492
+ cache.set(key, await checkedSynth(engine, text, { voice, style }));
466
493
  disk.write(key, cache.get(key).wav, ext);
467
494
  const u = cache.get(key).usage;
468
495
  // `cost` is OPTIONAL, and an installed engine is why (SPEC
@@ -488,6 +515,8 @@ export async function ttsMain(args) {
488
515
  ? `~$${u.cost.toFixed(4)} (session ~$${totalCost.toFixed(4)})`
489
516
  : `${totalChars} chars this session`;
490
517
  console.log(`${((Date.now() - t0) / 1000).toFixed(1)}s · ${u.note ?? `${text.length} chars`} · ${spend}`);
518
+ const { take } = cache.get(key);
519
+ if (take) console.log(` retried: ${takeLine(text, take)}`);
491
520
  }
492
521
  const { wav, usage } = cache.get(key);
493
522
  res.writeHead(200, {
@@ -502,6 +531,8 @@ export async function ttsMain(args) {
502
531
  : '0',
503
532
  'x-tts-tokens': usage.note ?? '',
504
533
  'x-tts-cached': fresh ? '0' : '1',
534
+ // a retried take, said once, for the deck's debug log to name its slide
535
+ ...(fresh && cache.get(key).take ? { 'x-tts-take': encodeURIComponent(takeLine(text, cache.get(key).take)) } : {}),
505
536
  });
506
537
  return res.end(wav);
507
538
  } catch (e) {
@@ -23,13 +23,15 @@
23
23
  // chirp — Chirp 3: HD on the Cloud Text-to-Speech API. Same 30 star-named
24
24
  // voices as gemini, ~1s a sentence, and 1M characters a month free.
25
25
  // No --style: Chirp has no delivery-instruction channel.
26
- // gemini — gemini-2.5-{pro,flash}-tts on Vertex AI. The only engine that
27
- // honors --style (default: warm, welcoming battle-hardened senior
28
- // engineer). No free tier, and pro is slow.
26
+ // gemini — gemini-2.5-{pro,flash}-tts on Vertex AI. Honors --style as a
27
+ // delivery instruction (default: warm, welcoming battle-hardened
28
+ // senior engineer). No free tier, and pro is slow.
29
29
  // elevenlabs — your ElevenLabs account's own voices, cloned ones included.
30
30
  // --voice takes the voice's NAME (or its id); omit it and the first
31
31
  // of YOUR voices is used, which is the point of the engine. Needs
32
- // $ELEVENLABS_API_KEY. No --style. --tts-format mp3 if your plan has
32
+ // $ELEVENLABS_API_KEY. On v3/v4, --style is a short audio-tag cue
33
+ // ("warmly"), cut at a word past 40 characters, and said so at the
34
+ // start; the default tone goes as its cue. --tts-format mp3 if your plan has
33
35
  // no PCM output — but this tool wants WAV (--keep-wav feeds
34
36
  // tools/lipsync.mjs), so pcm is the sane choice here.
35
37
  // Cloud engines: --project or $GOOGLE_CLOUD_PROJECT, auth via
@@ -52,11 +54,14 @@
52
54
  import { readFileSync, existsSync } from 'node:fs';
53
55
  import { resolve, join, basename } from 'node:path';
54
56
  import { homedir } from 'node:os';
55
- import { createEngine } from './tts-engines.mjs';
57
+ import { createEngine, voiceLang } from './tts-engines.mjs';
56
58
  import { createTtsCache } from './tts-cache.mjs';
59
+ import { cueFor, cutNote } from './tone-cue.mjs';
57
60
  import { argReader } from './args.mjs';
58
- import { sectionBodies } from './deck-html.mjs';
61
+ import { deckLang, sectionBodies } from './deck-html.mjs';
62
+ import { defaultTrackDir } from './deck-family.mjs';
59
63
  import { parseSlideRange } from './video.mjs';
64
+ import { lipsyncAfterVoicing } from './lipsync-auto.mjs';
60
65
  import { synthesizeSlides, readTrack, trackFormat, planLine, TRACK_FORMATS, DEFAULT_FORMAT } from './narration-synth.mjs';
61
66
 
62
67
  const args = process.argv.slice(2);
@@ -68,7 +73,7 @@ Usage:
68
73
  [--voice <name>] [--format m4a|wav|mp3] [--reuse-text] [--keep-wav]
69
74
  [--slides a-b] [--no-cache]
70
75
 
71
- The headless counterpart of the deck's V → Record this deck…: it reads each slide's speaker
76
+ The headless counterpart of the deck's V → Save with the deck: it reads each slide's speaker
72
77
  notes and writes one slide-NN file per slide (plus a file per [click] beat)
73
78
  and a manifest.json into <dir>, so a deck can point at it with
74
79
  narration: { files: '<dir>', segments: true } (m4a, the default)
@@ -81,12 +86,12 @@ A folder that already holds a track is REFRESHED as that track: its engine,
81
86
  voice, style and format are the defaults, so voicing one stale slide of a track
82
87
  the deck's recorder made writes wav in the same voice, beside the rest. A flag
83
88
  overrides any of them; a --slides run in another voice is refused, since a
84
- track has one voice.
89
+ track has one voice. A track with no saved voice requires --voice.
85
90
 
86
91
  -o <dir> output folder (default: <deck>/voiceover)
87
92
  --engine piper (local, free, default) · chirp · gemini · elevenlabs
88
93
  --voice the engine's voice name (piper: a model name; elevenlabs: omit
89
- for the first of YOUR voices)
94
+ for the first of YOUR voices on a fresh track)
90
95
  --format m4a (default for a new track) · wav · mp3 (an existing track
91
96
  keeps its own)
92
97
  --reuse-text re-voice the existing slide-NN.txt (edit one to change what is
@@ -96,6 +101,9 @@ track has one voice.
96
101
  --slides a-b voice only this range (1-based, inclusive; "7" for one slide)
97
102
  — every other slide's files and manifest entry are left alone
98
103
  --no-cache re-synthesize every slide, ignoring the shared clip cache
104
+ --no-face a deck with a 2D character (narration.character.mode: 'viseme')
105
+ has the lip-sync of what was voiced cut afterwards, with
106
+ Rhubarb, in parallel; this skips it
99
107
 
100
108
  Synthesis is cached on disk (~/.cache/decklight/tts) under a key made of
101
109
  (engine, model, format, voice, style, text) — the SAME key the live bridge
@@ -114,7 +122,7 @@ if (args.includes('--help') || args.includes('-h')) { console.log(HELP); process
114
122
  // take `out` for the deck.
115
123
  const VALUE_OPTIONS = new Set(['-o', '--engine', '--voice', '--style', '--data-dir', '--project',
116
124
  '--location', '--lang', '--tts-model', '--tts-format', '--slides', '--format']);
117
- const SWITCHES = new Set(['--reuse-text', '--keep-wav', '--no-cache']);
125
+ const SWITCHES = new Set(['--reuse-text', '--keep-wav', '--no-cache', '--no-face']);
118
126
  let deckPath;
119
127
  for (let i = 0; i < args.length; i++) {
120
128
  const a = args[i];
@@ -137,7 +145,8 @@ try { range = parseSlideRange(opt('--slides'), sectionBodies(html).length); } ca
137
145
  console.error(`decklight narrate: ${e.message}`);
138
146
  process.exit(1);
139
147
  }
140
- const outDir = resolve(opt('-o', join(resolve(deckPath, '..'), 'voiceover')));
148
+ // `voiceover`, or `voices-fr/voiceover` for the French of a deck: two languages never share a folder
149
+ const outDir = resolve(opt('-o', join(resolve(deckPath, '..'), defaultTrackDir(resolve(deckPath)))));
141
150
 
142
151
  // The track already in the folder, if any, and what it was voiced with: the
143
152
  // defaults for everything a flag does not say. Refreshing a track is voicing it
@@ -148,9 +157,10 @@ const engine = opt('--engine', prev?.engine ?? 'piper');
148
157
  const track = prev?.engine === engine ? prev : null; // its header speaks for THIS engine only
149
158
  // elevenlabs has no default name worth guessing: the roster is the account's,
150
159
  // and undefined means "the first of yours", which is what you came for
151
- const voice = opt('--voice', track ? track.voice : engine === 'piper' ? 'en_US-ryan-high'
152
- : engine === 'elevenlabs' ? undefined : 'Alnilam');
153
- const style = opt('--style', track?.style ??
160
+ const askedVoice = opt('--voice');
161
+ const voice = askedVoice ?? track?.voice ?? undefined;
162
+ const voiceId = askedVoice == null ? track?.voiceId : undefined;
163
+ let style = opt('--style', track?.style ??
154
164
  'Read in a warm, welcoming tone, like a friendly battle-hardened senior ' +
155
165
  'engineer who is still curious about new technology.');
156
166
  // the model is identity only where the engine has more than one per voice
@@ -168,31 +178,49 @@ let tts;
168
178
  try {
169
179
  tts = createEngine({
170
180
  engine, project, voice, dataDir, model,
171
- location: opt('--location'), lang: opt('--lang'), format: opt('--tts-format'),
181
+ location: opt('--location'), format: opt('--tts-format'),
182
+ // the deck's own language, unless --lang says otherwise (PRESENTING_VOICE)
183
+ lang: voiceLang({ flag: opt('--lang'), deck: deckLang(html) }),
172
184
  });
173
185
  } catch (e) {
174
186
  console.error(e.message);
175
187
  process.exit(1);
176
188
  }
177
189
 
178
- // `· N to voice` closes the line because the edit server reads it: an export
179
- // that voices its slides first counts them off against this number.
190
+ // A model that reads audio tags takes a tone as a short cue. A built-in
191
+ // tone's directive is named by its cue, so the clips are the ones the deck's
192
+ // live voice caches under it; a track keeps the style it was voiced with.
193
+ if (tts.audioTags) {
194
+ if (opt('--style') != null || track?.style == null) style = cueFor(style);
195
+ const cut = cutNote(style);
196
+ if (cut) console.log(`tone ${cut}`);
197
+ }
198
+
180
199
  console.log(planLine(basename(deckPath), html, range, !!opt('--slides')));
181
200
  const reuseTextFrom = args.includes('--reuse-text')
182
201
  // falls back to the deck's default voiceover/ scripts so a second take
183
202
  // (other engine/voice) narrates the SAME text, not a re-roll
184
- ? [outDir, join(resolve(deckPath, '..'), 'voiceover')]
203
+ ? [outDir, join(resolve(deckPath, '..'), defaultTrackDir(resolve(deckPath)))]
185
204
  : [];
186
205
  try {
187
206
  const cache = createTtsCache({ enabled: !args.includes('--no-cache') });
188
207
  cache.prune();
189
- const { skipped, cost } = await synthesizeSlides({
190
- html, dir: outDir, tts, voice, style, format,
208
+ const { skipped, cost, retried } = await synthesizeSlides({
209
+ html, dir: outDir, tts, voice, voiceId, style, format,
191
210
  range: opt('--slides') ? range : null, prev, cache, reuseTextFrom,
192
211
  keepWav: args.includes('--keep-wav'),
193
212
  });
194
213
  console.log(`done → ${outDir}${skipped ? ` (${skipped} unchanged, skipped)` : ''}`
195
214
  + (cost ? ` · estimated cost ~$${cost.toFixed(4)}` : ''));
215
+ // the takes sampled twice because the first did not fit its text: the
216
+ // sentences worth a listen before this track is played to anyone
217
+ if (retried.length) {
218
+ console.log(`${retried.length} take${retried.length === 1 ? '' : 's'} retried, worth a listen:`);
219
+ for (const line of retried) console.log(` ${line}`);
220
+ }
221
+ // a deck with a 2D character mouths this audio: its lip-sync is cut now,
222
+ // from what was just written, rather than left for --face (#1244)
223
+ if (!args.includes('--no-face')) await lipsyncAfterVoicing({ html, dir: outDir });
196
224
  } catch (e) {
197
225
  console.error(`decklight narrate: ${e.message}`);
198
226
  process.exitCode = 1;
@@ -1 +0,0 @@
1
- {"tag":"0.9.0","commits":0,"commit":"a3046d2","dirty":false}