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 .
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:
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 = units.map(unit => {
return {
command: `Select unit ${unit.name}`,
callback: async () => {
await selectUnit(unit.name)
}
}
});
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.
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.