© 2019 by Rational Touch.

Setup

1. Register with Woice.live​:

  • Registration is free using your Google account.

  • No credit card or additional personal informacion is required.

2. Download Woice SDK from dashboard.woice.live.

3. Add Woice SDK to your application:

<script type="text/javascript" src="woice_web.bundle.v2.0.0-rc5.js"></script>
 

4. Initialize Woice SDK with your API Key and your language of choice:

const myWoiceApp = woice.DriverBuilders.config()
        .lang('en-US')
        .addActionHandlers(openModal, startSound, endSound)
        .withSpeechRecognition()
        .withAutoTranscription()
        .connect('<my App Name>', '<my API Key>')
        .start();

5. Set up your desired Woice activation shortcut. For example:

document.addEventListener("keydown", function (zEvent) {
        if (zEvent.ctrlKey && zEvent.code === "KeyQ") {
          myWoiceApp.startSpeechRecognition();
        }
      });

Interaction

To handle appliction events triggered by Woice SDK after an intent has been identified* within your application, follow the following steps:

1. Woice SDK will trigger events in all the application's opened pages or modals. You must add a Javascript code to define wherther the page or modal should handle application events, which allows you to handle each application event in the right page or modal.

For example:

canHandle: (handlerInput) => {
  if (handlerInput.isIntent('start_order_processing')) {
    handlerInput.allow();
  }

};
 

2. Define how to handle application event within your application:

handle: (handlerInput) => {
  $("#launch_modal").click();
}

* Requires coupling your Woice application with your DialogFlow agent in Woice's private area after registering. 

* Advanced code samples, the detailed SDK specification, and implementation guidelines can be found in the private area after registering.