/** * Configuration message required as the first message after establishing the WebSocket connection. * Pass **exactly one** of `voice_id` (saved voice) or `ref_audio` (base64 reference clip). * `target_language_code` is optional: omit it to detect the language from the first * buffered text, then that language stays locked until the next config. * Optional `ref_text` improves fidelity when using `ref_audio`. * Sending both `voice_id` and `ref_audio` returns an error. Duration bounds, QC, and VAD * are not accepted on this path. */ export interface VoiceCloningConfigureConnection { type: "config"; data: VoiceCloningConfigureConnection.Data; } export declare namespace VoiceCloningConfigureConnection { interface Data { /** * BCP-47 language code for the synthesized output. The cloned voice can speak any * supported language, regardless of the reference clip's language. Omit it to * detect the language from the first buffered text. Detection is locked for the * rest of the session; send a new config with an explicit code to change language. * Detection can be wrong on short or code-mixed text. Romanized Indic and Urdu * return 400. Short Assamese without ৰ or ৱ is often detected as Bengali — pass * `as-IN`. */ target_language_code?: Data.TargetLanguageCode | undefined; /** * Cloned voice ID (`svc-{uuid}`) from your voice library. Create one with * `POST /voices/create`. Exactly one of `voice_id` or `ref_audio` must be provided. */ voice_id?: string | undefined; /** * Base64-encoded reference audio clip (WAV recommended; also MP3, FLAC, OPUS, AAC, * MULAW, ALAW, LINEAR16). Max 10 MB decoded size and 15 seconds. Exactly one of * `voice_id` or `ref_audio` must be provided. */ ref_audio?: string | undefined; /** * Optional transcript of `ref_audio` (max 500 characters). Improves fidelity. * Omit to let the API transcribe the clip. Ignored when `voice_id` is used. */ ref_text?: string | undefined; /** Speech speed (0.5–2.0). 1.0 = natural speed. */ pace?: number | undefined; /** Output sample rate in Hz. */ speech_sample_rate?: number | undefined; /** * Pre-TTS text normalization: numbers, currencies and dates converted to spoken * form before synthesis. Defaults to the server-side setting. */ enable_pretts?: boolean | undefined; /** * Remove background noise from the uploaded reference audio before synthesis. * Only applies when `ref_audio` is provided; ignored for `voice_id`. * Adds processing latency before the first audio chunk -- roughly 1 second * for a typical reference clip. */ remove_background_noise?: boolean | undefined; /** * Audio codec for streamed frames. Default is `mp3`. * Allowed: `mp3`, `wav`, `linear16`, `mulaw`, `alaw`. */ output_audio_codec?: Data.OutputAudioCodec | undefined; /** Bitrate for lossy codecs. Default is `128k`. */ output_audio_bitrate?: Data.OutputAudioBitrate | undefined; /** Minimum character length that triggers buffer flushing for synthesis. */ min_buffer_size?: number | undefined; /** Maximum length for sentence splitting. */ max_chunk_length?: number | undefined; } namespace Data { /** * BCP-47 language code for the synthesized output. The cloned voice can speak any * supported language, regardless of the reference clip's language. Omit it to * detect the language from the first buffered text. Detection is locked for the * rest of the session; send a new config with an explicit code to change language. * Detection can be wrong on short or code-mixed text. Romanized Indic and Urdu * return 400. Short Assamese without ৰ or ৱ is often detected as Bengali — pass * `as-IN`. */ const TargetLanguageCode: { readonly AsIn: "as-IN"; readonly BnIn: "bn-IN"; readonly EnIn: "en-IN"; readonly GuIn: "gu-IN"; readonly HiIn: "hi-IN"; readonly KnIn: "kn-IN"; readonly MlIn: "ml-IN"; readonly MrIn: "mr-IN"; readonly OdIn: "od-IN"; readonly PaIn: "pa-IN"; readonly TaIn: "ta-IN"; readonly TeIn: "te-IN"; }; type TargetLanguageCode = (typeof TargetLanguageCode)[keyof typeof TargetLanguageCode]; /** * Audio codec for streamed frames. Default is `mp3`. * Allowed: `mp3`, `wav`, `linear16`, `mulaw`, `alaw`. */ const OutputAudioCodec: { readonly Mp3: "mp3"; readonly Wav: "wav"; readonly Linear16: "linear16"; readonly Mulaw: "mulaw"; readonly Alaw: "alaw"; }; type OutputAudioCodec = (typeof OutputAudioCodec)[keyof typeof OutputAudioCodec]; /** Bitrate for lossy codecs. Default is `128k`. */ const OutputAudioBitrate: { readonly ThirtyTwoK: "32k"; readonly SixtyFourK: "64k"; readonly NinetySixK: "96k"; readonly OneHundredTwentyEightK: "128k"; readonly OneHundredNinetyTwoK: "192k"; }; type OutputAudioBitrate = (typeof OutputAudioBitrate)[keyof typeof OutputAudioBitrate]; } }