This commit is contained in:
Andras Schmelczer 2026-06-22 22:04:20 +01:00
parent 6c6780fc60
commit f7e0814a38
8 changed files with 206 additions and 92 deletions

View file

@ -1,8 +1,8 @@
import { existsSync, mkdirSync, statSync } from 'node:fs';
import { existsSync, mkdirSync, statSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { AUTH_STATE_PATH, LEAD_IN_S, OUTPUT_DIR } from './config.js';
import { assertHardwareWebGL, launchRecordingBrowser } from './browser.js';
import { narrationLog } from './narration.js';
import { cuesToVtt, narrationLog } from './narration.js';
import { installDemoRoutes } from './routes.js';
import type { Storyboard } from './script.js';
import { storyboards } from './storyboard.js';
@ -105,6 +105,11 @@ async function recordOne(storyboard: Storyboard): Promise<void> {
console.log(
`[${storyboard.name}] wrote ${cues.length} narration cues → ${join(dir, 'narration.json')}`
);
const vttPath = join(dir, 'narration.vtt');
writeFileSync(vttPath, cuesToVtt(cues));
console.log(
`[${storyboard.name}] wrote ${cues.length} WebVTT captions → ${vttPath}`
);
}
async function main(): Promise<void> {