Class TalkPayload.Builder

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

public static final class TalkPayload.Builder extends Object
Builder for configuring properties of TalkPayload.
  • Method Details

    • loop

      public TalkPayload.Builder loop(int loop)
      The number of times to repeat the message. The default value is 1, or you can use 0 to indicate that the message should be repeated indefinitely.
      Parameters:
      loop - The number of repetitions.
      Returns:
      This builder.
    • style

      public TalkPayload.Builder style(int style)
      The vocal style (vocal range, tessitura, and timbre) to use for text-to-speech. Each language has varying number of styles. Refer to the documentation for available values.
      Parameters:
      style - The language style as an integer.
      Returns:
      This builder.
    • level

      public TalkPayload.Builder level(double level)
      The volume level that the speech is played. This can be any value between -1 to 1 in 0.1 increments, with 0 being the default.
      Parameters:
      level - The volume of speech.
      Returns:
      This builder.
    • premium

      public TalkPayload.Builder premium(boolean premium)
      Specify whether to use the premium version of the specified style if available. Find out more information about Premium Voices in the Text-To-Speech guide.
      Parameters:
      premium - true to use premium voice or false for standard version (the default).
      Returns:
      This builder.
    • language

      The speech language to use.
      Parameters:
      language - Language code as an enum.
      Returns:
      This builder.
    • build

      public TalkPayload build()
      Constructs the TalkPayload object.
      Returns:
      A new TalkPayload instance with this builder's properties.