Table of Contents

Class TalkAction

Namespace
Vonage.Voice.Nccos
Assembly
Vonage.dll

Represents an NCCO Talk action that plays a text-to-speech message to the caller.

public class TalkAction : NccoAction
Inheritance
TalkAction
Inherited Members

Properties

Action

The type of NCCO action to execute.

[JsonProperty("action", Order = 0)]
public override NccoAction.ActionType Action { get; }

Property Value

NccoAction.ActionType

BargeIn

Set to true so this action is terminated when the user presses a button on the keypad. Use this feature to enable users to choose an option without having to listen to the whole message in your Interactive Voice Response (IVR ). If you set bargeIn to true on one more Stream actions then the next non-stream action in the NCCO stack must be an input action. The default value is false. Once bargeIn is set to true it will stay true (even if bargeIn: false is set in a following action) until an input action is encountered

[JsonProperty("bargeIn", Order = 2)]
public bool BargeIn { get; set; }

Property Value

bool

Language

The language (BCP-47format) for the message you are sending. Default: en-US. Possible values are listed in the Text-To-Speech guide .

[JsonProperty("language", Order = 6)]
public string Language { get; set; }

Property Value

string

Level

The volume level that the speech is played. This can be any value between -1 to 1 with 0 being the default.

[JsonProperty("level", Order = 4)]
public string Level { get; set; }

Property Value

string

Loop

The number of times text is repeated before the Call is closed. The default value is 1. Set to 0 to loop infinitely.

[JsonProperty("loop", Order = 3)]
public string Loop { get; set; }

Property Value

string

Premium

Set to true to use the premium version of the specified style if available, otherwise the standard version will be used. The default value is false.

[JsonProperty("premium", Order = 8)]
public bool Premium { get; set; }

Property Value

bool

Provider

The text-to-speech provider to use (ElevenLabs, Google, or Polly). If not specified, the default Vonage TTS engine is used.

[JsonProperty("provider", Order = 9)]
[JsonConverter(typeof(StringEnumConverter))]
public TalkAction.TalkProvider? Provider { get; set; }

Property Value

TalkAction.TalkProvider?

ProviderOptions

Provider-specific options as key-value pairs. The available options depend on the selected Provider.

[JsonProperty("providerOptions", Order = 10)]
public Dictionary<string, string> ProviderOptions { get; set; }

Property Value

Dictionary<string, string>

Style

The vocal style (vocal range, tessitura and timbre). Default: 0. Possible values are listed in the Text-To-Speech guide .

[JsonProperty("style", Order = 7)]
public int? Style { get; set; }

Property Value

int?

Text

A string of up to 1,500 characters (excluding SSML tags) containing the message to be synthesized in the Call or Conversation. A single comma in text adds a short pause to the synthesized speech. To add a longer pause a break tag needs to be used in SSML. To use SSML tags, you must enclose the text in a speak element.

[JsonProperty("text", Order = 1)]
public string Text { get; set; }

Property Value

string