Package com.vonage.client.voice.ncco
Class SpeechSettings.Builder
java.lang.Object
com.vonage.client.voice.ncco.SpeechSettings.Builder
- Enclosing class:
SpeechSettings
Builder for customising SpeechSettings parameters. All fields are optional.
- Since:
- 8.2.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the SpeechSettings object with this builder's properties.Hints to improve recognition quality if certain words are expected from the user.context(Collection<String> context) Hints to improve recognition quality if certain words are expected from the user.endOnSilence(double endOnSilence) Controls how long the system will wait after user stops speaking to decide the input is completed.language(SpeechSettings.Language language) Expected language of the user's speech.maxDuration(int maxDuration) Controls maximum speech duration (from the moment user starts speaking).saveAudio(boolean saveAudio) Controls whether the speech input recording (recording_url) is sent to your webhook endpoint ateventUrl.sensitivity(int sensitivity) Audio sensitivity used to differentiate noise from speech.startTimeout(int startTimeout) Controls how long the system will wait for the user to start speaking.The unique ID of the Call leg for the user to capture the speech of.
-
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
Hints to improve recognition quality if certain words are expected from the user.- Parameters:
context- The hint strings.- Returns:
- This builder.
- See Also:
-
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
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
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
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 isSpeechSettings.Language.ENGLISH_UNITED_STATES.- Parameters:
language- The expected speech language as an enum.- Returns:
- This builder.
-
saveAudio
Controls whether the speech input recording (recording_url) is sent to your webhook endpoint ateventUrl. The default value isfalse.- Parameters:
saveAudio-trueto 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.
-