set_agent_voice
set_agent_voice
Set the agent’s own voice, sent as the voice key of the SWML ai verb. A
language added with add_language() that has no voice of its own uses
this one.
The platform tries an agent’s voices in this order: the language’s own voice or voice
list, this voice for a language with none, the
set_fallback_voice() list, and the platform’s own last resort.
Parameters
voice
One voice as engine.voice:model, or a list of up to 8. In a list, the first voice
speaks and the rest are tried in order when it fails. A one-item list stays a list.
None clears the setting.
Returns
AgentBase — Returns self for method chaining.
Raises
ValueError for an empty voice, an empty list, a list of more than 8 voices, or a list
entry that isn’t a non-empty string.
Example
The ai verb renders with the voice list:
To set a voice for every voice field the agent leaves empty, including multilingual
languages, use set_default_voice().