How to control voice input using the mic button on the chatbot

Sometimes the chatbot mic input gets turned off before the chatbot user can finish the utterance and the partial utterance is sent for processing. This can be really annoying to slow speakers. To overcome this problem, we have introduced a new feature that will allow the admin users to give the chatbot user control over when to send the voice input for processing.

Settings

As an admin user, you can enable this setting in two places:

Bot Provider V2

  1. Go to Experience Designer > Bot Manager flow > Bot Provider V2 node > Bot Out Parser

  2. Place the below code.

    msg.payload.autoPost = false;

     

Chatbot settings

You can also enable this feature from Chatbot settings

  1. Navigate to the Experience Manager > select a project > Project side navigation menu > Develop > Chatbot Settings > Settings.

  2. The default setting is "autoPost": true

  3. Change the setting to "autoPost": false as shown in the screenshot below.

 

Chatbot Experience

When the “autoPost“ is set to false i.e; "autoPost": false

  1. The chatbot user should manually click on the “Send” button to send the processed Speech To Text input to the server.

     

  2. The user can use the mic input button to start/pause the recording. The converted Speech To Text value after the pause will be appended to the existing text in the user input box.

Related articles