Class TalkAction.Builder

java.lang.Object
com.vonage.client.voice.ncco.TalkAction.Builder
Enclosing class:
TalkAction

public static class TalkAction.Builder extends Object
  • Method Details

    • text

      Parameters:
      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.

      Returns:
      This builder.
    • bargeIn

      Parameters:
      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 the next action in the NCCO stack must be an input action. The default value is false.
      Returns:
      This builder.
    • loop

      Parameters:
      loop - The number of times text is repeated before the Call is closed. The default value is 1. Set to 0 to loop infinitely.
      Returns:
      This builder.
    • level

      public TalkAction.Builder level(Float level)
      Parameters:
      level - The volume level that the speech is played. This can be any value between -1 to 1 with 0 being the default.
      Returns:
      This builder.
    • language

      Parameters:
      language - The Language to use when converting the text to speech.
      Returns:
      This builder.
    • style

      Parameters:
      style - The vocal style to use.
      Returns:
      This builder.
    • premium

      Parameters:
      premium - Whether to use Premium text-to-speech. Set to true to use the premium version of the specified style if available, otherwise the standard version will be used.
      Returns:
      This builder.
    • build

      public TalkAction build()
      Returns:
      A new TalkAction object from the stored builder options.