@glissade/narrate 0.12.0 → 0.13.0-pre.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.
- package/dist/index.d.ts +29 -0
- package/dist/providers.js +5 -2
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -74,6 +74,23 @@ interface NarrationScript {
|
|
|
74
74
|
* the committed JSON. A segment's own `maxSec` wins over an entry here.
|
|
75
75
|
*/
|
|
76
76
|
budgets?: Record<string, number>;
|
|
77
|
+
/**
|
|
78
|
+
* How captions are delivered. `'burn'` = baked into the video frame (a fixed
|
|
79
|
+
* box that CANNOT scroll) — declaring it ESCALATES `gs narration-lint`'s
|
|
80
|
+
* caption-fit rule to Tier-1 (a hard, CI-failing error), because an overflow
|
|
81
|
+
* is unrecoverable at play time. `'sidecar'` = player-wrapped .srt/.vtt with
|
|
82
|
+
* no fixed box; caption-fit stays Tier-2 (warn-only). Omitted → sidecar
|
|
83
|
+
* semantics (warn-only) so a project that never declared intent exits 0.
|
|
84
|
+
* The signal lives HERE, in the committed script (it travels with the content),
|
|
85
|
+
* not behind a CLI flag (which drifts in CI config). Persisted into the manifest.
|
|
86
|
+
*/
|
|
87
|
+
captionMode?: 'burn' | 'sidecar';
|
|
88
|
+
/**
|
|
89
|
+
* A per-script caption-fit budget: the max wrapped lines a caption may use.
|
|
90
|
+
* Declaring it is an explicit caption-fit INTENT, so — like `captionMode:'burn'`
|
|
91
|
+
* — it ESCALATES caption-fit to Tier-1 (CI-failing). Persisted into the manifest.
|
|
92
|
+
*/
|
|
93
|
+
captionMaxLines?: number;
|
|
77
94
|
/** spoken segments and explicit pause beats, in playback order */
|
|
78
95
|
segments: NarrationElement[];
|
|
79
96
|
}
|
|
@@ -120,6 +137,18 @@ interface NarrationTiming {
|
|
|
120
137
|
* segment's own `maxSec` (on the TimedSegment) wins over an entry here.
|
|
121
138
|
*/
|
|
122
139
|
budgets?: Record<string, number>;
|
|
140
|
+
/**
|
|
141
|
+
* Caption delivery mode carried from the script. `'burn'` escalates
|
|
142
|
+
* `gs narration-lint`'s caption-fit rule to Tier-1 (CI-failing); `'sidecar'`
|
|
143
|
+
* / omitted keeps it Tier-2 (warn-only). Persisted so the lint reads intent
|
|
144
|
+
* from the committed manifest, no CLI flag.
|
|
145
|
+
*/
|
|
146
|
+
captionMode?: 'burn' | 'sidecar';
|
|
147
|
+
/**
|
|
148
|
+
* Per-script caption-fit budget (max wrapped lines) carried from the script.
|
|
149
|
+
* Its presence ESCALATES caption-fit to Tier-1, like `captionMode:'burn'`.
|
|
150
|
+
*/
|
|
151
|
+
captionMaxLines?: number;
|
|
123
152
|
}
|
|
124
153
|
declare class NarrationError extends Error {
|
|
125
154
|
constructor(message: string);
|
package/dist/providers.js
CHANGED
|
@@ -332,8 +332,9 @@ function kokoroProvider(opts = {}) {
|
|
|
332
332
|
return Promise.resolve(`kokoro-js ${version} ${basename(modelId)} dtype=${dtype}`);
|
|
333
333
|
},
|
|
334
334
|
synthesize: async (req) => {
|
|
335
|
-
const tts = await getModel();
|
|
336
335
|
const voice = req.voice ?? opts.voice ?? KOKORO_DEFAULT_VOICE;
|
|
336
|
+
if (voice.startsWith("zf_") || voice.startsWith("zm_")) throw new NarrationError("kokoro Chinese voices (z*) need misaki[zh] g2p (pinyin+jieba), which is not wired — kokoro-js routes zh through espeak-ng cmn (mismatched phonemes → garbled). Use --provider piper for Chinese. (tracked: card 24vKUw2HVC6D)");
|
|
337
|
+
const tts = await getModel();
|
|
337
338
|
const genOpts = req.rate !== void 0 && req.rate > 0 ? {
|
|
338
339
|
voice,
|
|
339
340
|
speed: req.rate
|
|
@@ -666,7 +667,9 @@ async function synthesizeScript(scriptPath, opts = {}) {
|
|
|
666
667
|
segments,
|
|
667
668
|
...pauses.length > 0 ? { pauses } : {},
|
|
668
669
|
...raw.captionSplit ? { captionSplit: raw.captionSplit } : {},
|
|
669
|
-
...raw.budgets && Object.keys(raw.budgets).length > 0 ? { budgets: raw.budgets } : {}
|
|
670
|
+
...raw.budgets && Object.keys(raw.budgets).length > 0 ? { budgets: raw.budgets } : {},
|
|
671
|
+
...raw.captionMode !== void 0 ? { captionMode: raw.captionMode } : {},
|
|
672
|
+
...raw.captionMaxLines !== void 0 ? { captionMaxLines: raw.captionMaxLines } : {}
|
|
670
673
|
};
|
|
671
674
|
const timingPath = `${base}.narration.timing.json`;
|
|
672
675
|
writeFileSync(timingPath, JSON.stringify(timing, null, 2) + "\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glissade/narrate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0-pre.0",
|
|
4
4
|
"description": "glissade narration + captions: TTS at prepare time (gs narrate), deterministic caching, narration-anchored timeline beats, and captions as plain tracks. Render stays offline.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@glissade/core": "0.
|
|
26
|
-
"@glissade/scene": "0.
|
|
25
|
+
"@glissade/core": "0.13.0-pre.0",
|
|
26
|
+
"@glissade/scene": "0.13.0-pre.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"kokoro-js": "^1.2.0"
|