SetSpeakMiddleware Class

  • java.lang.Object
    • com.microsoft.bot.builder.SetSpeakMiddleware

Implements

public class SetSpeakMiddleware
implements Middleware

Support the DirectLine speech and telephony channels to ensure the appropriate SSML tags are set on the Activity Speak property.

Constructor Summary

Constructor Description
SetSpeakMiddleware(String voiceName, boolean fallbackToTextForSpeak)

Initializes a new instance of the SetSpeakMiddleware class.

Method Summary

Modifier and Type Method and Description
java.util.concurrent.CompletableFuture<java.lang.Void> onTurn(TurnContext turnContext, NextDelegate next)

Processes an incoming activity.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

SetSpeakMiddleware

public SetSpeakMiddleware(String voiceName, boolean fallbackToTextForSpeak)

Initializes a new instance of the SetSpeakMiddleware class.

Parameters:

voiceName - The SSML voice name attribute value.
fallbackToTextForSpeak - true if an empt Activity.Speak is populated with Activity.getText().

Method Details

onTurn

public CompletableFuture onTurn(TurnContext turnContext, NextDelegate next)

Processes an incoming activity.

Parameters:

turnContext - The context Object for this turn.
next - The delegate to call to continue the bot middleware pipeline.

Returns:

A task that represents the work queued to execute.

Applies to