import type { ElevenLabsTTSModel } from './models.js'; import { TTS } from '../../agents/providers.js'; /** * ElevenLabs voice settings, mirroring ElevenLabs' native `voice_settings` shape. * * Provided as an alternative to the top-level {@link ElevenLabsTTSOptions} fields * (`stability`, `similarityBoost`, `style`, `useSpeakerBoost`). A value here is * only applied when the corresponding top-level option is left at its default. */ export type ElevenLabsVoiceSettings = { /** Voice consistency vs. expressiveness. Range 0-1. Lower is more varied/expressive. */ stability?: number | null; /** How closely the output matches the original voice. Range 0-1. */ similarity_boost?: number | null; /** Style exaggeration. Range 0-1. Higher amplifies the speaker's style. */ style?: number | null; /** Boosts similarity to the original speaker. */ use_speaker_boost?: boolean | null; }; /** * Configuration options for the ElevenLabs text-to-speech (TTS) provider. */ export type ElevenLabsTTSOptions = { /** ElevenLabs API key. Falls back to the `ELEVENLABS_API_KEY` environment variable when omitted. */ apiKey?: string; /** Voice ID to synthesize with. Default `'21m00Tcm4TlvDq8ikWAM'`. */ voice?: string; /** * ElevenLabs model ID. Default `'eleven_turbo_v2'`. * Other common values include `'eleven_multilingual_v2'` and `'eleven_flash_v2'`. */ model?: ElevenLabsTTSModel | string; /** Output audio sample rate in Hz. Default `24000`. */ sampleRate?: number; /** Voice consistency vs. expressiveness. Range 0-1. Default `0.5`. */ stability?: number; /** How closely the output matches the original voice. Range 0-1. Default `0.75`. */ similarityBoost?: number; /** Style exaggeration. Range 0-1. Default `0.0`. */ style?: number; /** Boosts similarity to the original speaker. Default `true`. */ useSpeakerBoost?: boolean; /** * Text normalization mode (e.g. expanding numbers and abbreviations). * Typical values: `'auto'`, `'on'`, `'off'`. Default `null` (provider default). */ applyTextNormalization?: string | null; /** Request per-word timestamps alongside the audio. Default `false`. */ enableWordTimestamps?: boolean; /** Speaking rate multiplier. Default `null` (provider default). */ speed?: number | null; /** Language code hint for synthesis (e.g. `'en'`). Default `null` (auto). */ language?: string | null; /** Whether to parse SSML markup in the input text. Default `null` (provider default). */ enableSsmlParsing?: boolean | null; /** Stream audio as it is generated rather than waiting for the full result. Default `true`. */ stream?: boolean; /** * Native ElevenLabs voice settings object. Used to populate voice parameters * (`stability`, `similarityBoost`, `style`, `useSpeakerBoost`) only where the * corresponding top-level option was left at its default. Default `null`. */ voiceSettings?: ElevenLabsVoiceSettings | null; /** Additional/forward-compatible options. Unknown keys are accepted and ignored. */ [key: string]: any; }; declare class ElevenLabsTTSImpl extends TTS { static readonly displayName = "ElevenLabsTTS"; _providerName: string; apiKey?: string; voiceId: string; voice: string; model: string; stability: number; similarityBoost: number; style: number; useSpeakerBoost: boolean; applyTextNormalization: string | null; enableWordTimestamps: boolean; speed: number | null; language: string | null; enableSsmlParsing: boolean | null; ttsStream: boolean; constructor(opts?: ElevenLabsTTSOptions); getRuntimeConfig(): Record; } /** Instance type of the ElevenLabs TTS provider returned by {@link ElevenLabsTTS}. */ export type ElevenLabsTTS = ElevenLabsTTSImpl; /** * ElevenLabs text-to-speech (TTS) provider. * * @param opts - Provider configuration. See {@link ElevenLabsTTSOptions}. * @returns A configured ElevenLabs TTS provider instance. */ export declare const ElevenLabsTTS: (opts?: ElevenLabsTTSOptions) => ElevenLabsTTS; export {};