# Automatic Voice Commands

{% hint style="info" %}
**Compatibility Requirements**

Automatically registered voice commands are currently only available on RealWear® compatible devices running version **21.6.1** and later of the JourneyApps Container version **4.84.0** of the JourneyApps Runtime.
{% endhint %}

### Enabling automatic voice commands

To enable automatic voice commands for your app, activate the **Automatic voice commands** flag under **App Settings** > **Feature Flags** (this requires an app deploy to take effect).

### Overview of automatically registered voice commands

JourneyApps automatically generates voice commands for UI components to save developers time in building voice controlled apps with good end user experience. These commands follow the "say what you see" pattern.

It is useful to distinguish between globally available voice commands (e.g. scrolling and basic navigation), along with dynamic commands that are only available within a specific context (e.g. commands available on a specific view, or within a specific dialog).

#### Globally available voice commands

These are general application commands that allow the user to interact with the app regardless of which UI components are present or activated.

| Voice Command           | Description                                                                                                                  |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Go Back; Navigate Back  | Dismisses to a previous view or cancels an action.                                                                           |
| Scroll down, Page down  | To scroll down on a view if the view extends beyond the RealWear device's display capacity.                                  |
| Scroll up, Page up      | To scroll down on a view if the view extends beyond the RealWear device's display capacity.                                  |
| Show diagnostics        | Takes the user to the built-in Diagnostics view.                                                                             |
| Show messages           | Takes the user to the built-in Messages view.                                                                                |
| Open menu               | Opens the app's top-right context menu (also referred to as kebab menu).                                                     |
| App help, Show App help | Displays an in-app help panel showing a summary of all current voice commands, based on the selected component and app view. |

#### Contextually unique dynamic voice commands

When an app user is on a view, there are many dynamic voice commands that are available automatically. The specific voice commands will depend on the specific UI components on the view, their identifying labels, and the actions users can take with the UI components.

The available commands will change as the view changes, or as components (e.g. dropdowns) are selected.

For some components there are commands for selecting the component (e.g. for selecting a `text-input` component to enter text) as well as clearing them (e.g. for clearing text). For other components, commands are generated to fire the action associated with "clicking" on individual items (e.g. for `list-item`).

Developers are encouraged to follow the the "say what you see" best practice with the default automatic voice commands. Input components and buttons alike are selected using its `label` attribute. That said, in some cases it might make sense to override the default automatic voice commands, for example if app users should be able to fire the `action` on a `list-item` using what is shown in the `content`.

Here are some more specific cases where contextually unique voice commands become available:

* When capturing a photo with the [`journey.photos` component](https://docs.journeyapps.com/reference/build/js-ts-apis/journey/journey.photos), the commands are: "Take Picture", "Flash on", "Flash off", "Flash auto", "Flash torch", and "Done". To zoom, the commands "Zoom level 0" to "Zoom level 5" are available.
* To open the [navigation drawer](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/navigation-navigation-drawer) on a compatible view, the "Show Navigation" voice command is used. "Hide Navigation" will hide it again.
* On [dialogs](https://docs.journeyapps.com/reference/build/js-ts-apis/journey/journey.dialog), users can say the label of the buttons to trigger/select them.
* When there is an [app update](https://docs.journeyapps.com/reference/app-runtime-and-container-updates#app-and-runtime-updates) available, the user will get a notification asking them to update now or later. The buttons have the corresponding labels registered as commands, i.e. "Update" and "Later".

### Visual in-app guidance when interacting with the app

When a voice command is recognized by RealWear, it is shown to the user. Additionally, JourneyApps highlights the UI component with which the user is interacting using a red indicator. In some cases, when a component is highlighted, other voice commands may become available to the user.

![](https://2865107717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9TCHLR67eLHBOjPvHhud%2Fuploads%2Fgit-blob-9c11b55a71a933b15c0c48a12a48ec36510f4c8a%2Fauto-voice-indicator.png?alt=media)

Note that the color of the indicator can be configured for the entire app, a specific view, or a specific component using the `active-indicator-color=""` attribute (see the [Component Styling and Configuration section](https://docs.journeyapps.com/reference/build/app-styling-and-customizations) for further information about the distinction between these levels).

The below code example illustrates how to change the indicator color to green on an app level for the default `light` theme.

In your app's `config.json`:

{% code title="config.json" %}

```json
{
    "name": "light",
    "colors": {
    "system": {
        ...
    },
    "custom": {}
    },
    "components": {
        "view": {
            "active-indicator-color": "#02cf72"
        }
    }
},
```

{% endcode %}

### "App help" - In-app guidance for users on which voice commands are available

In general, the "say what you see" pattern should apply when it comes to identifying which voice commands are available in any context. However, if an app user is stuck, they can simply say "App help". This will open the help panel - a list of all available voice commands. The list of commands will refresh as soon as the user performs an action.

![](https://2865107717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9TCHLR67eLHBOjPvHhud%2Fuploads%2Fgit-blob-e7c605eccb01c1174cc0888340631ceb1319498a%2Fauto-voice-app_help.png?alt=media)

A voice debugger is also available to developers to easily see what commands are available in any given moment on the app without the need for a RealWear device. Read more in the [advanced topics](https://docs.journeyapps.com/reference/app-features/realwear-r-voice-control/automatic-voice-commands/automatic-voice-commands-advanced).

{% hint style="info" %}
**Additional Notes**

* The term *element* is considered synonymous to *component*. To illustrate, the "First element" command as seen here in the help panel refers to the first UI component in the view.
* [Manually registered voice commands](https://docs.journeyapps.com/reference/app-features/realwear-r-voice-control/manual-voice-commands) appear in the help panel under the "Misc" header.
  {% endhint %}

See the [advanced topics](https://docs.journeyapps.com/reference/app-features/realwear-r-voice-control/automatic-voice-commands/automatic-voice-commands-advanced) for additional information about automatic voice commands, and important topics when developing voice-controlled apps on JourneyApps.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.journeyapps.com/reference/app-features/realwear-r-voice-control/automatic-voice-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
