SAGEA LogoDocs & API
Studio

Audio guide

Sonus TTS turns text into natural speech for IVR, ads, audiobooks, and alerts. This guide shows how to pick voices, tune delivery, choose formats, and scale past the per-request limit.

In this guide

  • Use preset voices or a cloned voice ID
  • Tune emotion and speed per use case
  • Pick format and sample rate for playback or telephony
  • Chunk long text and choose streaming, batch, or realtime

Pick a preset or cloned voice

Start with presets for speed of iteration. nova suits friendly assistants and narration, while atlas suits deeper, steadier delivery for news and IVR. Move to a cloned voice_id when the brand needs a consistent speaker across campaigns.

Clone once from a clean 1 to 2 minute sample, store the returned voice_id, and reuse it like a preset. Keep consent records for any cloned speaker.

# Preset voice
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": "नमस्ते, SAGEA मा स्वागत छ।", "voice": "nova", "response_format": "mp3"}' \
  --output hello-nova.mp3
 
# Cloned voice
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": "नमस्ते, SAGEA मा स्वागत छ।", "voice": "voice_abc123", "response_format": "mp3"}' \
  --output hello-cloned.mp3

For full schemas see Text to Speech and Voice Cloning.

Tune emotion and speed per use case

The same sentence lands differently with emotion and speed. IVR prompts should stay calm at normal speed so callers catch account numbers. Ads can run excited and slightly fast to carry energy.

Use caseEmotionSpeedWhy
IVR balance readoutcalm1.0Clear digits over phone audio
Ad for Dashain saleexcited1.1Upbeat promo energy
News narrationprofessional1.0Steady, neutral delivery
Bedtime storywarm0.9Softer, slower pacing
Support apologyfriendly1.0Empathetic without rushing
# IVR: calm and exact
synthesize_ivR = {"model": "sonus-tts", "voice": "atlas",
                  "emotion": "calm", "speed": 1.0,
                  "input": "Your balance is Rs. 12,400."}
 
# Ad: excited and brisk
synthesize_ad = {"model": "sonus-tts", "voice": "nova",
                 "emotion": "excited", "speed": 1.1,
                 "input": "Dashain offer! Kathmandu to Pokhara fares from Rs. 1,999!"}

Test each pair with native listeners before launch, especially for Nepali and Hindi mixes. See Multilingual narration.

Choose format and chunk long text

Each request accepts up to 4096 characters. Default to mp3 for apps and web, switch to wav at 16 kHz for telephony compatibility, and keep flac for lossless archives you plan to re-encode later.

GoalFormatNotes
App or web playbackmp3Small files, universal support
Telephony and IVRwavUse 16 kHz mono for carriers
Archive masterflacLossless, larger files
Streaming previewoggLow latency in browsers

Split long scripts on sentence boundaries, synthesize each chunk, then concatenate the audio. Never split mid-sentence or mid-number.

def chunk_text(text, limit=4000):
    chunks, cur = [], ""
    for sentence in text.split("। "):
        piece = sentence + "। "
        if len(cur) + len(piece) > limit:
            chunks.append(cur)
            cur = piece
        else:
            cur += piece
    if cur.strip():
        chunks.append(cur)
    return chunks
 
for n, part in enumerate(chunk_text(open("audiobook.txt").read())):
    synthesize(part, "nova", f"part-{n:03d}.mp3")
# Concatenate with ffmpeg: ffmpeg -i "concat:part-000.mp3|part-001.mp3" -c copy book.mp3

For a full pipeline with retries, see Audiobook pipeline.

Choose streaming, batch, or realtime

Pick the delivery mode by latency and interactivity needs. Batch is simplest, streaming starts playback faster, and realtime fits conversational agents.

ModeBest forLatencyEndpoint
Batch synthesisPrompts, ads, chaptersSeconds per fileText to Speech
StreamingLong narration, previewsFirst chunk fastAudio Stream
Realtime agentInterruptible voice botsLowest round tripMYLO sessions
# Streaming preview (first bytes arrive while the rest renders)
curl -N -X POST https://api.sagea.space/v1/audio/stream \
  -H "Authorization: Bearer $SAGEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "sonus-tts", "voice": "nova", "input": "Long narration text here..."}' \
  --output preview.mp3

Use batch for an IVR prompt pack, streaming for an audiobook preview page, and realtime when callers interrupt. See Realtime streaming.

Best practices

  • Prototype with nova and atlas, then lock a cloned voice_id for production.
  • Pin one emotion plus speed pair per use case and document it.
  • Keep mp3 as default, wav at 16 kHz for telephony, flac for masters.
  • Chunk at sentence boundaries under 4096 characters and keep numbering stable.
  • Normalize numbers and dates for Nepali text before synthesis.
  • Cache repeated prompts by text hash instead of re-synthesizing.

What's next

On this page