Tizen Native API
6.0
|
The Multi assistant provides functions for supporting users to use several assistants.
Required Header
#include <multi_assistant.h>
Client State Transitions
FUNCTION | PRE-CLIENT-STATE | POST-CLIENT-STATE | SYNC TYPE |
---|---|---|---|
ma_initialize() | None | Initialized | SYNC |
ma_deinitialize() | Initialized | None | SYNC |
ma_prepare() | Initialized | Ready | ASYNC |
ma_unprepare() | Ready | Initialized | SYNC |
Client State Dependent Function Calls
The following table shows client-state-dependent function calls. It is forbidden to call functions listed below in wrong client states. Violation of this rule may result in an unpredictable behavior.
Related Features
This API is related with the following features:
- http://tizen.org/feature/microphone
- http://tizen.org/feature/multi_assistant
It is recommended to use features in your application for reliability.
You can check if the device supports the related features for this API by using System Information, and control your application's actions accordingly.
To ensure your application is running only on devices with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on using features in your application can be found in the feature element description.
Typedefs | |
typedef void(* | ma_state_changed_cb )(ma_state_e previous, ma_state_e current, void *user_data) |
Called when the client state is changed. | |
typedef void(* | ma_error_cb )(ma_error_e reason, void *user_data) |
Called when the error is occurred. | |
typedef void(* | ma_language_changed_cb )(const char *previous, const char *current, void *user_data) |
Called when the default language is changed. | |
typedef void(* | ma_audio_streaming_cb )(ma_audio_streaming_event_e event, char *buffer, int len, void *user_data) |
Called when the multi-assistant service sends audio streaming. | |
typedef void(* | ma_active_state_changed_cb )(ma_active_state_e previous, ma_active_state_e current, void *user_data) |
Called when the active state is changed. | |
typedef void(* | ma_wakeup_engine_command_cb )(const char *command, void *user_data) |
Called when a wakeup engine specific command is retrieved. | |
typedef void * | ma_assistant_info_h |
A handle to get assistant information. | |
typedef int(* | ma_assistant_info_list_cb )(ma_assistant_info_h handle, void *user_data) |
Called whenever to get the assistant information of each installed assistant. | |
typedef void(* | ma_preprocessing_information_changed_cb )(const char *app_id, void *user_data) |
Called when the preprocessing information is changed. | |
typedef void(* | ma_audio_streaming_data_section_changed_cb )(ma_audio_streaming_data_section_e section, void *user_data) |
Called when the section of audio streaming data is changed. | |
typedef void(* | ma_service_state_changed_cb )(ma_service_state_e previous, ma_service_state_e current, void *user_data) |
Called when the service state is changed. | |
typedef void(* | ma_voice_key_status_changed_cb )(ma_voice_key_status_e status, void *user_data) |
Called when the multi-assistant service sends voice key status change event. |
Typedef Documentation
typedef void(* ma_active_state_changed_cb)(ma_active_state_e previous, ma_active_state_e current, void *user_data) |
Called when the active state is changed.
- Since :
- 5.5
- Parameters:
-
[in] previous The previous active state [in] current The current active state [in] user_data The user data passed from the callback registration function
typedef void* ma_assistant_info_h |
A handle to get assistant information.
- Since :
- 5.5
typedef int(* ma_assistant_info_list_cb)(ma_assistant_info_h handle, void *user_data) |
Called whenever to get the assistant information of each installed assistant.
- Since :
- 5.5
- Remarks:
- The handle should not be released.
- The handle is managed by the platform and will be released when application exits.
- Parameters:
-
[in] handle The handle of the assistant [in] user_data The user data passed from the callback registration function
typedef void(* ma_audio_streaming_cb)(ma_audio_streaming_event_e event, char *buffer, int len, void *user_data) |
Called when the multi-assistant service sends audio streaming.
- Since :
- 5.0
- Remarks:
- The buffer should not be released and can be used only in the callback. To use outside, make a copy.
- Parameters:
-
[in] event The audio streaming event [in] buffer The audio streaming data [in] len The length of the audio streaming data [in] user_data The user data passed from the callback registration function
typedef void(* ma_audio_streaming_data_section_changed_cb)(ma_audio_streaming_data_section_e section, void *user_data) |
Called when the section of audio streaming data is changed.
- Since :
- 5.5
- Parameters:
-
[in] section The current section information of audio streaming data [in] user_data The user data passed from the callback registration function
typedef void(* ma_error_cb)(ma_error_e reason, void *user_data) |
Called when the error is occurred.
The following error codes can be received:
MA_ERROR_NONE: Success
MA_ERROR_OUT_OF_MEMORY: Out of Memory
MA_ERROR_IO_ERROR: I/O error
MA_ERROR_INVALID_PARAMETER: Invalid parameter
MA_ERROR_TIMED_OUT: No answer from service
MA_ERROR_RECORDER_BUSY: Busy recorder
MA_ERROR_PERMISSION_DENIED: Permission denied
MA_ERROR_NOT_SUPPORTED: Multi-assistant NOT supported
MA_ERROR_INVALID_STATE: Invalid state
MA_ERROR_INVALID_LANGUAGE: Invalid language
MA_ERROR_ENGINE_NOT_FOUND: No available engine
MA_ERROR_OPERATION_FAILED: Operation failed
MA_ERROR_SERVICE_RESET: Service daemon reset
MA_ERROR_NOT_SUPPORTED_FEATURE: Not supported feature of current engine
- Since :
- 5.0
- Parameters:
-
[in] reason The error reason [in] user_data The user data passed from the callback registration function
typedef void(* ma_language_changed_cb)(const char *previous, const char *current, void *user_data) |
Called when the default language is changed.
- Since :
- 5.0
- Remarks:
- The previous can be used only in the callback. To use outside, make a copy. The current can be used only in the callback. To use outside, make a copy.
- Parameters:
-
[in] previous The previous language [in] current The current language [in] user_data The user data passed from the callback registration function
typedef void(* ma_preprocessing_information_changed_cb)(const char *app_id, void *user_data) |
Called when the preprocessing information is changed.
- Since :
- 5.5
- Remarks:
- The app_id should not be released and can be used only in the callback. To use outside, make a copy.
- If the app_id is NULL, it means there is no preprocessing voice assistant available.
- Parameters:
-
[in] app_id The application id of current preprocessing voice assistant [in] user_data The user data passed from the callback registration function
typedef void(* ma_service_state_changed_cb)(ma_service_state_e previous, ma_service_state_e current, void *user_data) |
Called when the service state is changed.
- Since :
- 6.0
- Parameters:
-
[in] previous The previous service state [in] current The new service state [in] user_data The user data passed from the callback registration function
typedef void(* ma_state_changed_cb)(ma_state_e previous, ma_state_e current, void *user_data) |
Called when the client state is changed.
- Since :
- 5.0
- Parameters:
-
[in] previous The previous state [in] current The current state [in] user_data The user data passed from the callback registration function
typedef void(* ma_voice_key_status_changed_cb)(ma_voice_key_status_e status, void *user_data) |
Called when the multi-assistant service sends voice key status change event.
- Since :
- 6.0
- Parameters:
-
[in] status The change of voice key status [in] user_data The user data passed from the callback registration function
typedef void(* ma_wakeup_engine_command_cb)(const char *command, void *user_data) |
Called when a wakeup engine specific command is retrieved.
- Since :
- 5.5
- Remarks:
- The command should not be released and can be used only in the callback. To use outside, make a copy.
- Parameters:
-
[in] command The wakeup engine specific command [in] user_data The user data passed from the callback registration function
Enumeration Type Documentation
enum ma_active_state_e |
enum ma_audio_channel_e |
enum ma_audio_type_e |
enum ma_error_e |
Enumerations for multi-assistant error codes.
- Since :
- 5.0
- Enumerator:
Enumerations for allowing preprocessing by other voice assistants.
- Since :
- 5.5
Enumerations for recognition result events.
- Since :
- 5.5
enum ma_service_state_e |
Enumerations for multi-assistant service state.
- Since :
- 6.0
enum ma_state_e |
Enumerations for voice key status change.
When the voice key is pressed, the "pressed" state is reported. If the voice key gets released within the timeout value for tap events, the voice key status value will be reported as "released after tap". Otherwise, "released after push" will be reported.
- Since :
- 6.0