change_voice
change_voice
Change the agent’s voice for the rest of the call. The new voice replaces the current language’s voice from the next batch of speech on, never in the middle of an utterance, and stays with that language for the rest of the call. It can be on a different TTS engine from the current voice.
Pass a list to give fallbacks: the first voice speaks, and the platform tries the others in order when it fails. When every voice in the list fails, the platform moves on to the agent’s fallback voices.
Parameters
voice
One voice in the engine.voice:model form a language’s voice takes, such as
"elevenlabs.rachel" (see add_language() and the
SWML languages reference), or a list of up to 8 of them.
A one-item list is sent as a list.
Returns
FunctionResult — self, for chaining.
Raises
ValueError for an empty string, an empty list, more than 8 voices, or a list
entry that isn’t a non-empty string.
Example
calmer_voice returns: