set_default_voice
set_default_voice
Set a voice for every voice field the agent leaves empty: the agent’s own voice, a
language with no voice, and a multilingual language with no voice. A voice the agent
sets itself, with set_agent_voice(),
add_language(), or set_multilingual(), takes
precedence.
The SDK sets the SWML variable default_voice with a set verb just before
the ai verb.
Parameters
voice
One of:
- One voice as
engine.voice:model. - A list of up to 8 voices. The first speaks and the rest are tried in order when it fails.
- A mapping from language codes to a voice or a list, with a
"default"entry for every other language. The platform matches a language by its exact code, then by its base language (esfores-MX), then by"default". When the agent has no multilingual languages of its own, the mapping’s languages become them. Noneclears the setting.
Returns
AgentBase — Returns self for method chaining.
Raises
ValueError for an empty voice, more than 8 voices, an empty mapping, or a mapping key
that isn’t a non-empty string.