Voice control elementary
You can register voice commands for EFL-supported UI components to allow the user to interact with visible UI components inside the application using their voice. The Voice control elementary library recognizes spoken commands from registered UI components.
This feature is supported in mobile applications only.
The following figure illustrates the application screen when the Voice control elementary features are enabled. When the screen is updated, any UI components that have a registered command and hint are shown with a tooltip (hint). When the user speaks the hint, the callback function of the action related to the UI component is executed.
Figure: Voice command hints on the screen
You have no need to consider how to recognize voice commands or start and stop the recognition process. A preloaded voice application handles the process automatically. You just need to set the command and hint on every EFL elementary component on which you want to use the voice command.
When the user speaks a command corresponding to a visible EFL elementary component on the screen, the recognized command is sent to the Voice control elementary library from the Voice control service, and the action mapped to the component is executed. For example, if the component is a button, the action can be a button click.
Figure: Voice command process
Note |
---|
The detailed implementation of the preloaded voice application (how to trigger and recognize the user speaking) can differ according to the device (mobile, wearable, or TV). |
The main features of the Voice control elementary API include:
- Managing commands and hints
You can set commands and hints for visible UI components on the application screen. The hint message shows the user which command must be spoken to interact with that UI component. When the user speaks a command, the command is executed.
- Retrieving information
You can get various information from the Voice control elementary API:
- Default language
You can start the recognition with any language you want. However, if you do not set a specific language, the Voice control elementary library start recognizing voice commands with the default language.
- Supported language
You can retrieve a list of supported languages to check whether the language that you want is supported.
- Supported UI components, actions, and commands
You can retrieve a list of supported UI components that can be interacted with using the voice commands. You can also retrieve a list of supported actions and their commands for each UI component type.
- Default language
The following table lists the EFL UI components that support voice commands, and the actions supported by each component and already defined in the configuration file. Note that the label component only supports the hint without any action command.
UI component | Action/command | ||||
---|---|---|---|---|---|
click/() | up/up | down/down | left/left | right/right | |
Button | Yes | No | No | No | No |
Check | Yes | No | No | No | No |
Ctxpopup | Yes | No | No | No | No |
Entry | Yes | No | No | No | No |
Gengrid | No | Yes | Yes | Yes | Yes |
Genlist | No | Yes | Yes | No | No |
Label | No | No | No | No | No |
Radio | Yes | No | No | No | No |
Slider | No | Yes | Yes | Yes | Yes |
Spinner | No | Yes | Yes | Yes | Yes |
Toolbar | No | Yes | Yes | Yes | Yes |
To use the voice commands:
- Initialize the Voice control elementary library and create a handle.
The Voice control elementary handle is used to set user-defined commands and hints for the corresponding UI component in the application.
- Set commands and hints.
With a handle related to the individual UI component in the application screen, you can specify a command used to distinguish that component from others.
Along with the command, you can set a hint message. The command and hint can be different, but consistency tends to create a better user experience. You can also set a hint without a command simply to provide information to the user.
- When no longer needed, destroy the handle and deinitialize the Voice control elementary library.
Note |
---|
Set the commands and hints on visible EFL elementary UI components only. When the visible components on the screen change, the commands and hints must also change. |