jovotech / jovo-starter-web-standalone

Fully customizable open source voice experience that can be hosted on any website.
https://www.jovo.tech/demos/starter-web-standalone
33 stars 9 forks source link

How to configure so that example is conversational and not tap-to-talk? #8

Open rmtuckerphx opened 1 year ago

rmtuckerphx commented 1 year ago

How to change this example from tap-to-talk to auto-mic-on?

Testing in Chrome (Windows) I've updated the configuration in client/src/main.ts as follows:

{
  endpointUrl: process.env.VUE_APP_CLIENT_ENDPOINT_URL || 'http://localhost:3000/webhook',
  config: {
    input: {
      audioRecorder: {
        startDetection: {
          enabled: false,
        },
        silenceDetection: {
          enabled: false,
        },
      },
      speechRecognizer: {
        lang: 'en',
        startDetection: {
          enabled: true,
          timeoutInMs: 3000,
        },
        silenceDetection: {
          enabled: true,
          timeoutInMs: 3000,
        },        
      },
    },
    output: {
      reprompts: {
        enabled: true,
      },
    },
    store: {
      shouldPersistSession: false,
    },

  },
}

When I click the initial button, I get the LAUNCH message, but the microphone doesn't turn on automatically. If I tap-to-talk then the next turn works and at the end of the spoken response, the mic turns on automatically as it should. The reprompt also seems to work with an issue if you don't respond and then go back to tap-to-talk.

The main issue I need help solving is getting the initial response to open the mic.

rmtuckerphx commented 1 year ago

I'm fine with the initial button being a tap which speaks the first response:

image

But at the end of speaking, it shows the mic button ready to tap.

image

What I expect is the mic to automatically turn on at the end of the TTS. This happens on the second, third, ... response but not the first one.

image

rmtuckerphx commented 1 year ago

@jankoenig @aswetlow

Is there a way to override in Client.ts the following code?

    this.on(ClientEvent.RepromptLimitReached, () => {
      this.store.resetSession();
      this.store.save();
    });

When the reprompt limit is reached, maybe I want to revert back to a tap-to-talk and not end the session. If the session is going to be reset, shouldn't the client redirect back to the opening screen with the right arrows?