CookbooksVoice Cookbooks
Multilingual Narration with Sonus
Render the same script in en-US, ne-NP, hi-IN, and es-ES with POST https://api.sagea.space/v1/audio/speech.
- Synthesize one message in four locales
- Pick a natural per-language voice for each locale
- Save four MP3 files with consistent emotion and speed
Time to complete: ~15 minutes
Prerequisites
- Python 3.9+ with
pip install requests. - A SAGEA API key exported as
SAGEA_API_KEY. - UTF-8 editor for Devanagari script in Nepali and Hindi.
- Read Synthesize speech with Sonus for request shape.
- Skim the Sonus TTS model card for the 30 plus supported languages.
Step 1: Prepare one script in four languages
Use the same meaning in each locale. Keep each input under 4096 characters.
Save the dict above for the next step. Sonus supports 30+ languages.
Step 2: Synthesize each locale with its own voice
Per-language voices sound more native than reusing one voice everywhere.
Run with pip install requests, python multilingual.py, then ls -lh narration-*.mp3.
Step 3: Check consistency across locales
Verify all four files decode and compare durations:
If one locale sounds rushed, use 0.95 speed for that file only. Keep warm emotion fixed. Rates of 16kHz, 24kHz, and 44.1kHz are supported.
Verify
All four MP3 files should play with native prosody. If a call fails, check the error table below.
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | API key missing or invalid | Run echo $SAGEA_API_KEY and re-export the key |
400 text_too_long | Script exceeds 4096 chars | Split into sentences and synthesize in parts |
422 voice_not_found | Voice does not cover that locale | Fall back to nova or a valid vox_ voice |
429 rate_limit_exceeded | Over 50 req per min on Starter, 500 on Pro | Space requests out and retry with backoff |
