Sarvam AI icon

Sarvam AI

Indian language AI APIs — transcribe, speak, and chat across 22+ Indian languages

Actions3

Speech → Text to Speech

AI-generated

Summary

Convert text to speech in a selected Indian language

Inputs

  • text (required) — The text to convert to speech (max 2500 characters)
  • ttsTargetLanguage (required) — Language for text normalization before synthesis
  • textToSpeechOptions — Options for fine‑tuning synthesis such as codec, speaker, speed, temperature, and sample rate

Output shape

binary audio payload with accompanying JSON request ID

The binary part contains the spoken audio; the JSON part includes a request_id. The binary data is provided under the 'binary' field and may be empty on error.

Examples

Example 1: Create a Hindi greeting audio

text='Namaste', ttsTargetLanguage='hi-IN', output_audio_codec='wav', speaker='shubh'

Example 2: Generate English audio with MP3 and faster pace

text='Hello world', ttsTargetLanguage='en-IN', output_audio_codec='mp3', pace=1.5

Example 3: Translate Tamil text to speech using a different speaker

text='நான் இனிமேல் தங்கினäste', ttsTargetLanguage='ta-IN', speaker='sophia', output_audio_codec='mp3'

Links

Discussion