/** * Narration (TTS) generation. * * `generateNarration` synthesizes a single narration clip for a project from a * text script via a TTS backend (from the audio-platform registry), writes the * audio to `projects//artifacts/audio/narration.wav`, and persists a * `narration.json` artifact describing it. When a `videoDurationMs` is supplied, * the artifact also embeds a pure `planNarrationFit()` plan (atempo / loop-video * timing) so a downstream assemble step can fit the narration to the video bed. * * Pure-ish: `env` and `fetcher` are threaded through to the backend so tests * run fully offline with no real keys or network. Throws `tts_failed` when no * requested/available TTS backend can run. */ import type { NarrationFitPlan } from './assemble/narration-fit.js'; export declare const NARRATION_SCHEMA_VERSION = 1; export interface NarrationArtifact { schemaVersion: typeof NARRATION_SCHEMA_VERSION; projectSlug: string; generatedAt: string; backendId: string; voice?: string; text: string; /** Project-relative path to the generated narration audio. */ path: string; durationMs: number; /** * Backends that failed (in order) before `backendId` succeeded, when the * automatic fallback chain was used. Omitted when the first backend succeeded * or an explicit `--backend` was given (explicit selection never falls back). */ fallbackFrom?: string[]; /** Present only when a videoDurationMs was supplied. */ fit?: NarrationFitPlan; } export interface GenerateNarrationOptions { workspaceRoot: string; slug: string; text: string; voice?: string; /** Restrict to this backend id (defaults to the first AVAILABLE backend). */ backendId?: string; /** When given, embed a planNarrationFit() plan in the artifact. */ videoDurationMs?: number; dryRun?: boolean; env?: NodeJS.ProcessEnv; fetcher?: typeof fetch; } export declare function narrationArtifactPathFor(root: string, slug: string): string; export declare function narrationAudioDirFor(root: string, slug: string): string; export declare function readNarrationArtifact(root: string, slug: string): Promise; /** * Generate a single narration clip + persist the `narration.json` artifact. * Returns the written artifact. Throws `tts_failed` when no requested/available * TTS backend can run. */ export declare function generateNarration(options: GenerateNarrationOptions): Promise; //# sourceMappingURL=narrate.d.ts.map