export interface Pcm { data: Buffer; sampleRate: number; channels: number; } export interface OpusResult { path: string; durationMs: number; dir: string; } /** * Strip everything that doesn't belong in spoken audio: code blocks, inline * code, images, bare URLs, markdown markers, table pipes. The model is asked to * pre-condense into colloquial prose; this is a defensive backstop so a stray * code fence or link never gets read aloud verbatim. */ export declare function toSpoken(s: string): string; /** Exact playback duration of a 16-bit PCM buffer. */ export declare function pcmDurationMs(pcm: Pcm): number; /** Wrap raw signed-16 PCM in a minimal canonical WAV container. */ export declare function pcmToWav(pcm: Pcm): Buffer; /** Whether `opusenc` (opus-tools) is on PATH. Cached after first probe. * spawnSync sets `error` (ENOENT) when the binary is missing; `opusenc * --version` exits 0, so presence == no spawn error. */ export declare function hasOpusenc(): boolean; export declare const OPUSENC_HINT = "\u7F3A\u5C11 opus \u7F16\u7801\u5668\uFF1A\u8BF7\u5B89\u88C5 opus-tools\uFF08Debian/Ubuntu: `apt-get install -y opus-tools`\uFF1BmacOS: `brew install opus-tools`\uFF09\u3002"; /** * Encode PCM → a single ogg/opus file suitable for a Feishu voice bubble. * Returns the file path, its temp dir (caller rm -rf), and exact duration. */ export declare function encodePcmToOpus(pcm: Pcm): OpusResult; //# sourceMappingURL=audio.d.ts.map