ShunyaLabs Text-to-Speech
A high-quality, low-latency speech synthesis API built specifically for Indian languages. Generate natural speech from text with 46 voices across 23 Indic languages and English.
Choose your path
Before you start, decide which synthesis mode fits your use case.
Batch synthesis
Send text via HTTP POST and receive a complete audio file in a single response. Best for pre-rendered content, notifications, and offline pipelines.
Real-time streaming
Open a persistent WebSocket connection and receive audio chunks in real time as synthesis happens. Best for voice agents, IVR, and conversational AI.
Key features
Indic-first voices
23 languages, 46 speakers — purpose-built for Indian speech patterns and pronunciation.
Cross-lingual synthesis
Any voice can speak any language. Voice controls accent, not language — mix and match freely.
Expression styles
11 style tags — Happy, Sad, News, Narrative, Conversational, and more — for natural, expressive speech.
Feature overview
| Feature | Description |
|---|---|
| Indic-first voices | 23 languages, 46 speakers — purpose-built for Indian speech patterns |
| Cross-lingual synthesis | Any voice can speak any language. Voice controls accent, not language. |
| Expression styles | 11 style tags — Happy, Sad, News, Narrative, Conversational, and more |
| Voice Cloning | Clone any voice from 1–6 seconds of reference audio |
| 7 audio formats | PCM, WAV, MP3, OGG Opus, FLAC, mulaw, alaw |
| Audio processing | Speed control, silence trimming, volume normalization, background audio |
How the API works
| — | Batch | Streaming |
|---|---|---|
| Transport | HTTP POST | WebSocket |
| Input | Text string | Text chunks |
| Response | Single audio file | Audio chunks in real time |
| Config object | TTSConfig | TTSConfig |
| Best for | Pre-rendered content, notifications | Voice agents, IVR, conversational AI |
Minimal example
import asyncio
from shunyalabs import AsyncShunyaClient
from shunyalabs.tts import TTSConfig
async def main():
async with AsyncShunyaClient() as client:
result = await client.tts.synthesize(
"नमस्ते, आज मौसम बहुत अच्छा है।",
config=TTSConfig(model="zero-indic", voice="Varun"),
)
result.save("output.mp3")
asyncio.run(main())SHUNYALABS_API_KEY and omit api_key=. The SDK picks it up automatically.