Agent

Custom TTS

Point your agent at your own text-to-speech provider โ€” a cloned brand voice, a regional accent, or an in-house model โ€” while keeping the rest of the Katexs pipeline unchanged.


Supported shapes

  • Streaming HTTP โ€” Chunked audio response. Simplest to implement and good enough under 300ms time-to-first-byte.
  • WebSocket โ€” Lowest latency and supports mid-sentence cancellation for clean barge-in. Recommended for production.
  • Batch โ€” Whole-utterance synthesis. Acceptable for short fixed lines only; it will feel slow in conversation.

Configure it

json
{
  "tts": {
    "provider": "custom",
    "url": "wss://tts.example.com/v1/stream",
    "auth": { "type": "bearer", "secret_ref": "MY_TTS_KEY" },
    "voice_id": "brand-female-warm",
    "model": "turbo-v3",
    "output": { "encoding": "linear16", "sample_rate": 16000 },
    "speed": 1.0,
    "stability": 0.5,
    "similarity": 0.75,
    "supports_cancel": true
  }
}

Latency budget

StageTargetNotes
Time to first audio byte< 300msThe single biggest driver of perceived responsiveness.
Chunk cadenceโ‰ค 200msGaps larger than this are audible as stutter.
Cancellation ack< 100msRequired for the agent to stop talking when interrupted.
Total pipeline< 800msTranscriber + model + TTS from end of caller speech.

Barge-in and cancellation

When the caller interrupts, Katexs sends a cancel frame and discards buffered audio. If your provider cannot cancel, set supports_cancel to false โ€” the agent will synthesize in shorter segments instead, which costs a little naturalness but keeps interruptions responsive.

Pronunciation control

Custom Keywords still apply: replacement rules run before text reaches your provider, so brand names and spelled-out numbers arrive already corrected. If your provider supports SSML, enable ssml: true and Katexs will pass through emphasis and break tags.

xml
<speak>
  Your appointment is <break time="200ms"/>
  <emphasis level="moderate">Tuesday at ten</emphasis>.
</speak>

Fallback

Set a fallback_voice from the stock Voice Library. If your provider errors or exceeds the first-byte timeout, the agent switches voices mid-call rather than dropping it, and the call is tagged tts_fallback.

Cost is billed by your provider directly. Katexs still meters call minutes, but not synthesis characters, when a custom TTS is active.