/** * tts.ts — CRAFT-05 Real Text-to-Speech ("Read Aloud") * * Cross-platform text-to-speech via the host operating system's built-in * speech engine. The companion module `read-aloud.ts` only *analyses* prose * rhythm/rhyme; this module actually *speaks* it so the author can HEAR the * cadence — the practice the craft docs call for. * * Engines, by platform: * - Windows (win32): PowerShell + System.Speech.Synthesis.SpeechSynthesizer * - macOS (darwin): `say` * - Linux: `spd-say`, falling back to `espeak` / `espeak-ng` * * Safety: the manuscript text is NEVER interpolated into a shell command. * It is written to a temporary file and the engine is told to read that file * (Windows/macOS/espeak), or it is passed as a discrete argv entry through * `execFile` (spd-say), which spawns the binary directly without a shell. * * Philosophy: "Reading aloud reveals weak parts." — Hemingway / Harrison */ export interface SpeakOptions { /** * Speech rate. The scale is engine-specific: * - macOS `say` / espeak: words per minute (e.g. 175) * - Windows SpeechSynthesizer: -10..10 (values are clamped to this range) */ rate?: number; /** Named voice to use (engine-specific identifier). */ voice?: string; /** When set, render audio to this file (WAV on Windows/Linux, AIFF on macOS) instead of speaking. */ outFile?: string; } export interface SpeakResult { /** The engine actually used, or `'none'` when no engine was available. */ engine: string; /** True when speech (or file render) succeeded. */ spoken: boolean; /** Human-readable note: which file was written, why nothing was spoken, etc. */ note?: string; } /** * Speak `text` aloud (or render it to `opts.outFile`) using the host OS speech * engine. Never throws on a missing engine — degrades gracefully and returns * `{ spoken: false }` with an explanatory note. * * @param text - Prose to speak. Treated as untrusted; never shell-interpolated. * @param opts - Optional rate, voice, and output-file overrides. */ export declare function speak(text: string, opts?: SpeakOptions): Promise; //# sourceMappingURL=tts.d.ts.map