Voice settings¶
You can customize the voice of your AI agent in two ways:
At the global level: you can specify voice settings for the AI agent at the project level. For details, see Changing the voice, accent and rate.
Granularly for every individual intent: you can define how the AI agent should sound when pronouncing specific phrases.
To customize the voice of your agent granularly, add the voice()
parameter to the play()
function. In the voice()
parameter, you can define the following voice settings:
Voice setting |
Type |
Description |
---|---|---|
|
two-letter language code |
Language, or accent, in which the response must be played. Supported languages:
|
|
string |
Voice gender: male or female |
|
number |
Voice type: 0 (standard for the selected gender) or 1 (custom voice) |
Note
For languages other than English, some voice settings may not be supported.
Assume you want your AI agent to tell a fairy tale using different voices. To do this, you can add an intent of the following type:
let storyTellerVoice = voice(en, 'male');
let motherVoice = voice(en, 'female', 0);
let redHatVoice = voice(en, 'female', 2);
intent("Alan, tell me a fairy tale", p => {
p.play(storyTellerVoice, "Once upon a time there was a sweet little girl who always wore a cap made of red velvet.");
p.play(storyTellerVoice, "One day her mother said to her");
p.play(motherVoice, "Come Little Red Cap. Here is a piece of cake and a bottle of wine. Take them to your grandmother.");
p.play(storyTellerVoice, "Little Red Cap said");
p.play(redHatVoice, "I'll do everything just right.");
});