An es-MX voice with an es-ES request: Sume compares primary language

Sume's TTS language check compares regional tags by primary language, so es-MX against es-ES passes. What that means for accent, and what 409 you get otherwise.

3 min readSume
All posts

Sume TTS 1.0 checks that the voice you picked speaks the language you asked for. The rule in Sume's TTS documentation is that regional tags compare by primary language, and that fil and tl count as a match. So a voice saved as Spanish (Mexico) and a request with language: "es-ES" passes without a warning.

What the check does and does not catch

  • It catches Spanish voice, Portuguese request: a different primary language.
  • It does not catch es-MX voice, es-ES request: the primary language is the same, so the accent difference is your call.
  • It does not catch a wrong script inside the text, for example English words in a Spanish script.

What a real mismatch returns

A known mismatch returns HTTP 409 tts_voice_language_mismatch with voice_id, voice_language, request_language and guidance, before a job is created and before any charge. On Sume's hosted MCP the tts_create tool instead returns a non-error tts_voice_language_warning result with confirmation_required: true. The retry that goes with it is the same request and idempotency key with confirm_language_mismatch: true; the voice, transcript and language stay unchanged.

A habit for regional scripts

Pick the voice whose region matches your audience, then set language to the same tag. A script for Mexico City should use an es-MX voice and es-MX, even though es alone would pass. The tag is also what you will see in your own records later, so it documents intent.

Why compare only the primary language

A language check is a guard against an obvious error, not an accent referee. Voices are recorded by speakers in a place, and the same speaker can read text from a neighboring region fluently. If Sume demanded an exact regional match it would refuse requests that sound fine, and callers would learn to ignore the warning. Matching on the primary language keeps the 409 for cases that are actually wrong, such as a Portuguese voice reading Spanish text.

Test it for a cent

Render the same 200-character script twice, once with the regional tag your voice carries and once with a different region of the same language, and listen. A 200-character job costs 1 cent at $0.0475 per 1,000 characters, which is Sume's minimum. If you cannot hear a difference, keep the matching tag and move on.

Related posts

More in Developers

All Developers posts

Written by Sume