Manual Voice Commands

Automatic Voice Commands

We recommend relying on automatic voice commands for most use cases. That said, some UI components are not yet explicitly supported by automatic voice commands, and in those cases it may be possible to implement workarounds using the manual voice commands described below.

Please read more about automatic voice commands.

Compatibility Requirements

The journey.voice service is currently only available on RealWearยฎ compatible devices running version 21.6.1 and later of the JourneyApps Container and version 4.82.0 and later of the JourneyApps Runtime.

The journey.voice service allows developers to register voice commands via JavaScript / TypeScript to trigger custom code when a command is spoken.

Check capabilities

Use the journey.voice.getCapabilities() method check if voice commands are supported:


which returns an object:

  supported: true

Reset Commands

On each view, it is recommended to reset the voice service in order to ensure that any old commands are no longer registered.


Registering voice commands

There are two methods available for registering voice commands: journey.voice.registerCommand and journey.voice.registerCommands.

The first is used to register a single command:

journey.voice.registerCommand(command, callback);

// e.g.

journey.voice.registerCommand("Sync", function() {

The second is used to register multiple commands:


// e.g.
    command: "Sync",
    callback: function() {
    command: "Start Inspection",
    callback: function() {'start_inspection');

Custom commands based on data is also supported. This example maps through the measurement_units DB objects and creates voice commands in the format Select Unit X where X is the specific unit.

let units = await (DB.measurement_units.all().toArray());

let unitCommands = => {
  return {
    command: `Select unit ${}`,
    callback: async () => {
      await selectUnit(

await journey.voice.registerCommands(unitCommands);

Focusing a text input

A workflow may require a user to enter some data in a <text-input> component.

To do so, add an id field to the text input component, e.g.

<text-input label="Enter Name" bind="name" required="false" id="username" />

and focus the field using the focus() component method:

await journey.voice.registerCommand('Enter Name', () => {
  component.textInput({id: 'username'}).focus();

De-registering a command

If a single voice command should be removed, the journey.voice.deregisterCommand method can be used:


// e.g.
journey.voice.deregisterCommand('Enter Name');

Special considerations

Voice commands can trigger any JavaScript/TypeScript function that is normally available to developers. This includes examples like:

component.textInput({id: 'username'}).focus();'view_name');
journey.hardware.scanBarcode({types: ["EAN_8"]});"A new task is available", {buttons: [{
    label: "Go to task",
    onPress: () => {'task_view');

In the example above, the button's on-press will be called when the label text has been spoken, e.g. "Go to task".

Note that normal buttons aren't automatically registered as voice commands, but can easily be done in this way:

    <button label="Show Confirm" on-press="$:showConfirm()" validate="false" style="solid" />
    <button label="Trigger notification" on-press="$:triggerNotification()" validate="false" style="solid" />
    command: "Show Confirm",
    callback: showConfirm // not 'showConfirm()'
    command: "Trigger notification",
    callback: triggerNotification // not 'triggerNotification()'

Note that the callbacks in this example are the instance of the function, and not calling the function. Therefore, it doesn't have the brackets () at the end of the function name.

Good practices

  • Ensure that the user can "say what they see". For example, if a button has the label "Go Back", don't register the command as "Back".

  • Don't register single syllable commands like "up", since they can easily be picked up incorrectly. Rather, use something like "Go up".

  • The engine relies on spoken commands, so don't use homophones, e.g. "Bored" and "Board", since the device will not be able to distinguish between them.

Note that commands are case-insensitive.

Last updated