Class TalkAction.Builder

    • Constructor Detail

      • Builder

        public Builder​(java.lang.String 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.

    • Method Detail

      • text

        public TalkAction.Builder text​(java.lang.String 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:
        The TalkAction.Builder to keep building.
      • bargeIn

        public TalkAction.Builder bargeIn​(java.lang.Boolean 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:
        The TalkAction.Builder to keep building.
      • loop

        public TalkAction.Builder loop​(java.lang.Integer 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:
        The TalkAction.Builder to keep building.
      • level

        public TalkAction.Builder level​(java.lang.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:
        The TalkAction.Builder to keep building.
      • voiceName

        public TalkAction.Builder voiceName​(VoiceName voiceName)
        Parameters:
        voiceName - The name of the voice used to deliver text. You use the voiceName that has the correct language, gender and accent for the message you are sending.

        For example, the default voice VoiceName.KIMBERLY is a female who speaks English with an American accent (en-US).

        Returns:
        The TalkAction.Builder to keep building.