import type * as core from "../../../../../core/index.mjs"; import type * as SarvamAI from "../../../../index.mjs"; /** * @example * { * voice_id: "svc-123e4567-e89b-12d3-a456-426614174000", * text: "\u0928\u092E\u0938\u094D\u0924\u0947\u0964 \u092F\u0939 \u090F\u0915 \u0938\u094D\u091F\u094D\u0930\u0940\u092E\u093F\u0902\u0917 \u091F\u0947\u0938\u094D\u091F \u0939\u0948\u0964", * output_audio_codec: "mp3" * } */ export interface VoiceCloningStreamRequest { /** Saved cloned voice ID (`svc-{uuid}`) from `POST /voices/create` or Content Studio. Exactly one of `ref_audio` or `voice_id` must be provided — sending both returns `400`. Prefer `voice_id` when you already saved the voice so you do not re-upload the clip. */ voice_id?: string; /** * Reference audio clip used to clone the voice for this request. Supported formats: WAV, MP3, FLAC, OPUS, AAC, MULAW, ALAW, LINEAR16. WAV is recommended. * * Limits: max file size 10 MB; max duration 15 seconds; single speaker. Exactly one of `ref_audio` or `voice_id` must be provided — sending both returns `400`. */ ref_audio?: core.file.Uploadable | undefined; /** Optional transcript of `ref_audio` (max 500 characters). Improves fidelity when provided. Omit or leave empty to let the API transcribe the clip. Ignored when `voice_id` is used. */ ref_text?: string; /** Text to synthesize in the cloned voice. Native scripts and code-mixed text are supported. Maximum 1000 characters; longer text is rejected with a 400. Split longer input client-side and synthesize it in parts. */ text: string; /** * BCP-47 language code for the synthesized output. The cloned voice can speak any supported language, regardless of the reference clip's language (cross-lingual cloning). Omit it to detect the language from `text`. Detection can be wrong on short or code-mixed text — pass this when pronunciation has to be exact. Romanized Indic and Urdu return 400; short Assamese without ৰ or ৱ is often detected as Bengali, so pass `as-IN`. * * **Available Options:** * - `as-IN`: Assamese * - `bn-IN`: Bengali * - `en-IN`: English (Indian) * - `gu-IN`: Gujarati * - `hi-IN`: Hindi * - `kn-IN`: Kannada * - `ml-IN`: Malayalam * - `mr-IN`: Marathi * - `od-IN`: Odia * - `pa-IN`: Punjabi * - `ta-IN`: Tamil * - `te-IN`: Telugu */ language_code?: SarvamAI.VoiceCloningLanguage; /** Speech speed multiplier. `1.0` is natural speed; `0.5` to `2.0` is accepted. Speed is adjusted without changing pitch. */ pace?: number; /** * Audio codec for the streamed output. Default is `mp3`. * * - `mp3`: Self-framing; clients can decode and play as chunks arrive. Recommended. * - `wav`: One RIFF header (unknown length), then raw PCM chunks. * - `linear16`: Raw 16-bit PCM (no header). * - `mulaw` / `alaw`: 8-bit telephony codecs for IVR pipelines. */ output_audio_codec?: SarvamAI.VoiceCloningStreamCodec; /** Bitrate for lossy codecs (`mp3`). Default is `128k`. Options: `32k`, `64k`, `96k`, `128k`, `192k`. */ output_audio_bitrate?: SarvamAI.SpeechStreamBitrate; /** Output sample rate in Hz. Supported values are 8000, 16000, 22050, 24000, 32000, 44100, 48000. If omitted, the API returns 24000 Hz. */ speech_sample_rate?: SarvamAI.SpeechSampleRate; /** Enable pre-TTS text normalization: numbers, currencies and dates are converted to their spoken form before synthesis (e.g. `9840950950` becomes the spoken digit sequence). Defaults to the server-side setting. */ enable_text_normalization?: boolean; /** Remove background noise from the reference audio before synthesis. Uses ML-powered vocal extraction to isolate the speaker's voice. Only applies when `ref_audio` is provided; ignored when using `voice_id` (a saved voice keeps whatever processing it received when it was created). Adds processing latency before the first audio chunk -- roughly 1 second for a typical reference clip. */ remove_background_noise?: boolean; }