SAGEA LogoDocs & API
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.

curl -X POST https://api.sagea.space/v1/audio/speech \
  -H "Authorization: Bearer $SAGEA_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "sonus-tts", "input": "Good morning. Your journey begins here.", "voice": "nova", "response_format": "mp3", "emotion": "warm", "speed": 1.0}' \
  --output narration-en-US.mp3

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.

curl -X POST https://api.sagea.space/v1/audio/speech \
  -H "Authorization: Bearer $SAGEA_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "sonus-tts", "input": "शुभ प्रभात। तपाईंको यात्रा यहाँबाट सुरु हुन्छ।", "voice": "sagar", "response_format": "mp3", "emotion": "warm", "speed": 1.0}' \
  --output narration-ne-NP.mp3
curl -X POST https://api.sagea.space/v1/audio/speech \
  -H "Authorization: Bearer $SAGEA_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "sonus-tts", "input": "Buenos días. Tu viaje comienza aquí.", "voice": "luna", "response_format": "mp3", "emotion": "warm", "speed": 1.0}' \
  --output narration-es-ES.mp3

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:

for f in narration-en-US.mp3 narration-ne-NP.mp3 narration-hi-IN.mp3 narration-es-ES.mp3; do echo "== $f =="; ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1 "$f"; done

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.

ErrorCauseFix
401 UnauthorizedAPI key missing or invalidRun echo $SAGEA_API_KEY and re-export the key
400 text_too_longScript exceeds 4096 charsSplit into sentences and synthesize in parts
422 voice_not_foundVoice does not cover that localeFall back to nova or a valid vox_ voice
429 rate_limit_exceededOver 50 req per min on Starter, 500 on ProSpace requests out and retry with backoff

What's next

On this page