import type { TtsProvider, TtsRequest, TtsResult } from "./types.js";
export interface ProviderPickOptions {
    language?: string;
    preferQuality?: boolean;
}
/**
 * Picks the PRIMARY single-shot TTS provider for a request: Gemini-via-
 * OpenRouter (PRD-0003 §2). Callers that want automatic edge fallback should
 * use generateWithFallback({ provider: "auto" }) instead — pickProvider returns
 * a single provider with no fallback semantics.
 *
 * The agent endpoint (/api/audio/tts) historically called pickProvider and got
 * edge-only with no fallback; it now goes through generateWithFallback for
 * symmetry with the dialog endpoint.
 */
export declare function pickProvider(_opts?: ProviderPickOptions): TtsProvider;
export declare function getProviderById(id: string): TtsProvider | null;
/**
 * Generates audio with Gemini-first fallback semantics (PRD-0003 §2 — the chain
 * flipped from edge→openai to Gemini→edge; the openai-direct path is retired):
 *
 *   - provider:"auto" (default) → try Gemini (OpenRouter); if it is unavailable
 *     OR throws, try edge-tts; if both fail, throw an aggregated error naming
 *     both failures.
 *   - provider:"gemini"   → only Gemini (no fallback).
 *   - provider:"edge-tts" → only edge-tts.
 *
 * "available" means the provider's isAvailable() resolves true. An unavailable
 * provider is skipped without invoking generate(); a provider that becomes
 * available but throws at generate() time still triggers the fallback in auto.
 */
export declare function generateWithFallback(req: TtsRequest, opts?: {
    provider?: "auto" | "gemini" | "edge-tts";
}): Promise<TtsResult & {
    providerId: string;
}>;
export declare const ALL_TTS_PROVIDERS: TtsProvider[];
export interface SynthesizeNarrationOpts {
    text: string;
    /** Edge voice id (e.g. "zh-CN-XiaoxiaoNeural"); Gemini fallback maps it. */
    voice?: string;
    language?: string;
    /** Output container; defaults to mp3. Only the extension is honoured. */
    format?: string;
    /** Absolute path of the work's directory; audio lands under assets/audio/. */
    workDir: string;
    /** Optional override for the output filename stem (defaults to a hash). */
    filenameStem?: string;
    /** Force a single provider; defaults to "auto" (Gemini → edge). */
    provider?: "auto" | "gemini" | "edge-tts";
}
export interface SynthesizeNarrationResult {
    /** Absolute path of the resulting audio file. */
    assetPath: string;
    /** Relative-to-workDir path, suitable for composition.yaml assets[].uri. */
    relativeUri: string;
    /** Provider that actually produced the audio ("gemini" | "edge-tts"). */
    providerId: string;
    /** Probed duration in seconds (0 if ffprobe unavailable). */
    duration: number;
    /** Byte size of the audio file. */
    bytes: number;
}
export declare function synthesizeNarration(opts: SynthesizeNarrationOpts): Promise<SynthesizeNarrationResult>;
//# sourceMappingURL=registry.d.ts.map