Class PromptCreator

java.lang.Object
com.sinch.sdk.domains.voice.models.v2.helpers.PromptCreator

public final class PromptCreator extends Object
Fluent creator of a menu prompt, given to the lambdas of MenuItemCreator.prompt and Menu.prompt(java.util.function.Consumer<com.sinch.sdk.domains.voice.models.v2.helpers.PromptCreator>)

Messages are played in the order they are added, at most 10.

Since:
2.4
  • Method Details

    • text

      public PromptCreator text(String text, String voiceName)
      Add a text-to-speech message in plain text
      Parameters:
      text - Text to synthesize
      voiceName - Voice used for speech synthesis
      Returns:
      This creator
      Since:
      2.4
    • text

      public PromptCreator text(String text, VoiceName voiceName)
      Add a text-to-speech message in plain text
      Parameters:
      text - Text to synthesize
      voiceName - Voice used for speech synthesis, from the catalog
      Returns:
      This creator
      Since:
      2.4
    • ssml

      public PromptCreator ssml(String ssml, String voiceName)
      Add a text-to-speech message in SSML
      Parameters:
      ssml - SSML document (<speak>...</speak>) to synthesize
      voiceName - Voice used for speech synthesis
      Returns:
      This creator
      Since:
      2.4
    • ssml

      public PromptCreator ssml(String ssml, VoiceName voiceName)
      Add a text-to-speech message in SSML
      Parameters:
      ssml - SSML document (<speak>...</speak>) to synthesize
      voiceName - Voice used for speech synthesis, from the catalog
      Returns:
      This creator
      Since:
      2.4
    • play

      public PromptCreator play(String url)
      Add an audio file to play
      Parameters:
      url - URL of the media to play
      Returns:
      This creator
      Since:
      2.4
    • allowBargeIn

      public PromptCreator allowBargeIn(boolean allowBargeIn)
      Set whether user input interrupts the prompt. The API default is true
      Parameters:
      allowBargeIn - false to play the whole prompt before evaluating the input, which is still collected during playback
      Returns:
      This creator
      Since:
      2.4