Class SpeechSettings.Builder

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

public static final class SpeechSettings.Builder extends Object
Builder for customising SpeechSettings parameters. All fields are optional.
Since:
8.2.0
  • Method Details

    • uuid

      The unique ID of the Call leg for the user to capture the speech of. The first joined leg of the call by default.
      Parameters:
      uuid - The call leg ID to capture as a string.
      Returns:
      This builder.
    • context

      Hints to improve recognition quality if certain words are expected from the user.
      Parameters:
      context - The collection of hint strings.
      Returns:
      This builder.
      See Also:
    • context

      public SpeechSettings.Builder context(String... context)
      Hints to improve recognition quality if certain words are expected from the user.
      Parameters:
      context - The hint strings.
      Returns:
      This builder.
      See Also:
    • endOnSilence

      public SpeechSettings.Builder endOnSilence(double endOnSilence)
      Controls how long the system will wait after user stops speaking to decide the input is completed. The default value is 2.0 (seconds). The range of possible values is between 0.4 and 10.0 seconds.
      Parameters:
      endOnSilence - The input completion wait time in seconds as a double.
      Returns:
      This builder.
    • startTimeout

      public SpeechSettings.Builder startTimeout(int startTimeout)
      Controls how long the system will wait for the user to start speaking. The range of possible values is between 1 second and 60 seconds. The default value is 10.
      Parameters:
      startTimeout - The initial speech timeout in seconds as an integer.
      Returns:
      This builder.
    • maxDuration

      public SpeechSettings.Builder maxDuration(int maxDuration)
      Controls maximum speech duration (from the moment user starts speaking). The default value is 60 (seconds). The range of possible values is between 1 and 60 seconds.
      Parameters:
      maxDuration - The maximum speech duration in seconds as an integer.
      Returns:
      This builder.
    • sensitivity

      public SpeechSettings.Builder sensitivity(int sensitivity)
      Audio sensitivity used to differentiate noise from speech. An integer value where 10 represents low sensitivity and 100 maximum sensitivity. Default is 90.
      Parameters:
      sensitivity - The audio sensitivity as an integer.
      Returns:
      This builder.
    • language

      Expected language of the user's speech. Default is SpeechSettings.Language.ENGLISH_UNITED_STATES.
      Parameters:
      language - The expected speech language as an enum.
      Returns:
      This builder.
    • saveAudio

      public SpeechSettings.Builder saveAudio(boolean saveAudio)
      Controls whether the speech input recording (recording_url) is sent to your webhook endpoint at eventUrl. The default value is false.
      Parameters:
      saveAudio - true to send the speech input to the event webhook.
      Returns:
      This builder.
    • build

      Builds the SpeechSettings object with this builder's properties.
      Returns:
      A new SpeechSettings instance.