Voice Command

The voice command component provides for a page to have a central source of control over events that fire when you are using voice activation.

This enables you to handle the top level events for voice like changes in status or deal with the raw voice data in a custom way.

Setting up voice command

You first must set the type of voice control the project uses.

Go to project settings and change the “Voice Commands” dropdown from the “no voice commands” option to “Azure Voice”.

Then in project settings still, you need to provide an Azure voice API key. You also must use the action “Turn on Voice Commands (Media)” in order for the system to start listening to your voice.

This is because we don’t always want the system to be listening as soon as it is running and so it starts off and it is up to the author of the app to turn voice commands on and off.

Now add a voice command component to your page. While this page is visible and voice commands are active, the events will fire. This means you can have a different voice command component on each page so that it handles things differently if needed.

Alternatively you can put a voice command component in a foreground so that it affects every page the foreground is on.


Properties for Voice Command Component




Events that can Trigger an Action on the Voice Command Component


On Voice:

Action occurs whenever we receive data from the Azure Voice service.

Common use for this is to pipe the data to a text display for debug, or to pipe it through to a JS action to do more complex processing.

On Voice Status:

Action occurs whenever the connection to Azure Voice status changes between disconnected, connecting and connected.

This is usually used to display the status so the user can see if you are connected.

On Voice Failed Match:

Action occurs when we get a result from Azure Voice but it does not match any of the components on the page that has a voice activated action.

The common use for this it to display a message to the user to indicate that they were heard but their command didn’t match any available.

On Voice Sound Level:

 This provides a number that indicates what sound volume the mic is receiving.

This is commonly passed into a JS action that can then setup a sound meter visual display.