Tizen Native API
5.5
|
The Multi assistant client API provides functions for getting queries from multi assistant service and sending responses.
Functions | |
int | ma_initialize (void) |
Initializes multi-assistant client. | |
int | ma_deinitialize (void) |
Deinitializes multi-assistant client. | |
int | ma_prepare (void) |
Prepares multi-assistant client. | |
int | ma_unprepare (void) |
Unprepares multi-assistant client. | |
int | ma_get_state (ma_state_e *state) |
Gets the current state of the multi-assistant client. | |
int | ma_get_current_language (char **language) |
Gets the current language of multi-assistant client. | |
int | ma_get_recording_audio_format (int *rate, ma_audio_channel_e *channel, ma_audio_type_e *audio_type) |
Gets the recording audio format. | |
int | ma_set_state_changed_cb (ma_state_changed_cb callback, void *user_data) |
Sets a state changed callback. | |
int | ma_unset_state_changed_cb (void) |
Unsets a state changed callback. | |
int | ma_set_error_cb (ma_error_cb callback, void *user_data) |
Sets an error callback. | |
int | ma_unset_error_cb (void) |
Unsets an error callback. | |
int | ma_set_language_changed_cb (ma_language_changed_cb callback, void *user_data) |
Sets a language changed callback. | |
int | ma_unset_language_changed_cb (void) |
Unsets a language changed callback. | |
int | ma_set_audio_streaming_cb (ma_audio_streaming_cb callback, void *user_data) |
Sets an audio streaming callback. | |
int | ma_unset_audio_streaming_cb (void) |
Unsets an audio streaming callback. | |
int | ma_send_asr_result (ma_asr_result_event_e event, const char *asr_result) |
Sends ASR(auto speech recognition) results to the multi-assistant service. | |
int | ma_send_result (const char *display_text, const char *utterance_text, const char *result_json) |
Sends results to the multi-assistant service. | |
int | ma_send_recognition_result (ma_recognition_result_event_e result) |
Sends recognition result to the multi-assistant service. | |
int | ma_set_active_state_changed_cb (ma_active_state_changed_cb callback, void *user_data) |
Sets the active state changed callback. | |
int | ma_unset_active_state_changed_cb (void) |
Unsets the active state changed callback. | |
int | ma_start_receiving_audio_streaming_data (ma_audio_streaming_data_type_e type) |
Starts receiving audio streaming data. | |
int | ma_stop_receiving_audio_streaming_data (ma_audio_streaming_data_type_e type) |
Stops receiving audio streaming data. | |
int | ma_update_voice_feedback_state (ma_voice_feedback_state_e state) |
Sends an update of the client's voice feedback state to the server. | |
int | ma_send_assistant_specific_command (const char *command) |
Sends assistant-specific command to the server. | |
int | ma_set_wakeup_engine_command_cb (ma_wakeup_engine_command_cb callback, void *user_data) |
Sets the wakeup engine command callback. | |
int | ma_unset_wakeup_engine_command_cb (void) |
Unsets the wakeup engine command callback. | |
int | ma_assistant_info_foreach_assistants (ma_assistant_info_list_cb callback, void *user_data) |
Retrieves the information about all installed voice assistant applications. | |
int | ma_assistant_info_get_app_id (ma_assistant_info_h handle, char **app_id) |
Gets the app id of the specified handle. | |
int | ma_assistant_info_get_enabled_status (ma_assistant_info_h handle, bool *status) |
Gets the enabled status of the specified handle. | |
int | ma_get_recording_audio_source_type (char **type) |
Gets the recording audio source type. | |
int | ma_set_background_volume (double ratio) |
Sets the background volume. | |
int | ma_set_preprocessing_allow_mode (ma_preprocessing_allow_mode_e mode, const char *app_id) |
Sets the preprocessing allow mode. | |
int | ma_set_preprocessing_information_changed_cb (ma_preprocessing_information_changed_cb callback, void *user_data) |
Sets the preprocessing information changed callback. | |
int | ma_unset_preprocessing_information_changed_cb (void) |
Unsets the preprocessing information changed callback. | |
int | ma_send_preprocessing_result (bool is_success) |
Sends the preprocessing result. | |
int | ma_set_wake_word_audio_require_flag (bool require) |
Sets whether multi-assistant service should send wake word audio data. | |
int | ma_set_audio_streaming_data_section_changed_cb (ma_audio_streaming_data_section_changed_cb callback, void *user_data) |
Sets the section changed callback for audio streaming data. | |
int | ma_unset_audio_streaming_data_section_changed_cb (void) |
Unsets the section changed callback for audio streaming data. |
int ma_assistant_info_foreach_assistants | ( | ma_assistant_info_list_cb | callback, |
void * | user_data | ||
) |
Retrieves the information about all installed voice assistant applications.
[in] | callback | The callback for getting the information of installed assistants. |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_assistant_info_get_app_id | ( | ma_assistant_info_h | handle, |
char ** | app_id | ||
) |
Gets the app id of the specified handle.
[in] | handle | The handle to the assistant's information |
[out] | app_id | The application ID of the given assistant handle |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
int ma_assistant_info_get_enabled_status | ( | ma_assistant_info_h | handle, |
bool * | status | ||
) |
Gets the enabled status of the specified handle.
[in] | handle | The handle to the assistant's information |
[in] | status | The enable status of the given assistant handle |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
int ma_deinitialize | ( | void | ) |
Deinitializes multi-assistant client.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_get_current_language | ( | char ** | language | ) |
Gets the current language of multi-assistant client.
[out] | language | The current language |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
int ma_get_recording_audio_format | ( | int * | rate, |
ma_audio_channel_e * | channel, | ||
ma_audio_type_e * | audio_type | ||
) |
Gets the recording audio format.
[out] | rate | The audio sampling rate |
[out] | channel | The audio channel |
[out] | audio_type | The audio type |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
MA_ERROR_OPERATION_FAILED | Operation failed |
int ma_get_recording_audio_source_type | ( | char ** | type | ) |
Gets the recording audio source type.
[out] | type | The audio source type |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
MA_ERROR_OPERATION_FAILED | Operation failed |
int ma_get_state | ( | ma_state_e * | state | ) |
Gets the current state of the multi-assistant client.
[out] | state | The current state |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_initialize | ( | void | ) |
Initializes multi-assistant client.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_OPERATION_FAILED | Operation failed |
MA_ERROR_OUT_OF_MEMORY | Out of memory |
int ma_prepare | ( | void | ) |
Prepares multi-assistant client.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_send_asr_result | ( | ma_asr_result_event_e | event, |
const char * | asr_result | ||
) |
Sends ASR(auto speech recognition) results to the multi-assistant service.
[in] | event | The ASR result event (e.g. MA_ASR_RESULT_EVENT_FINAL_RESULT) |
[in] | asr_result | The ASR result text |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
int ma_send_assistant_specific_command | ( | const char * | command | ) |
Sends assistant-specific command to the server.
[in] | command | The command to be sent to the server |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
int ma_send_preprocessing_result | ( | bool | is_success | ) |
Sends the preprocessing result.
[in] | is_success | The result value to be sent, indicating whether the preprocessing succeeded or not |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_STATE | Invalid state |
MA_ERROR_OPERATION_FAILED | Operation failed |
int ma_send_recognition_result | ( | ma_recognition_result_event_e | result | ) |
Sends recognition result to the multi-assistant service.
[in] | result | The recognition result |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
int ma_send_result | ( | const char * | display_text, |
const char * | utterance_text, | ||
const char * | result_json | ||
) |
Sends results to the multi-assistant service.
[in] | display_text | The text shown on the display |
[in] | utterance_text | The utterance text |
[in] | result_json | The result data (JSON format) |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
int ma_set_active_state_changed_cb | ( | ma_active_state_changed_cb | callback, |
void * | user_data | ||
) |
Sets the active state changed callback.
[in] | callback | The callback |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_set_audio_streaming_cb | ( | ma_audio_streaming_cb | callback, |
void * | user_data | ||
) |
Sets an audio streaming callback.
[in] | callback | The callback |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_set_audio_streaming_data_section_changed_cb | ( | ma_audio_streaming_data_section_changed_cb | callback, |
void * | user_data | ||
) |
Sets the section changed callback for audio streaming data.
[in] | callback | The callback |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_set_background_volume | ( | double | ratio | ) |
Sets the background volume.
[in] | ratio | The volume ratio to be set |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
MA_ERROR_OPERATION_FAILED | Operation failed |
int ma_set_error_cb | ( | ma_error_cb | callback, |
void * | user_data | ||
) |
Sets an error callback.
[in] | callback | The callback |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_set_language_changed_cb | ( | ma_language_changed_cb | callback, |
void * | user_data | ||
) |
Sets a language changed callback.
[in] | callback | The callback |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_set_preprocessing_allow_mode | ( | ma_preprocessing_allow_mode_e | mode, |
const char * | app_id | ||
) |
Sets the preprocessing allow mode.
[in] | mode | The preprocessing allow mode to be set |
[in] | app_id | The application ID of the assistant to perform preprocessing |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_STATE | Invalid state |
MA_ERROR_OPERATION_FAILED | Operation failed |
int ma_set_preprocessing_information_changed_cb | ( | ma_preprocessing_information_changed_cb | callback, |
void * | user_data | ||
) |
Sets the preprocessing information changed callback.
[in] | callback | The callback |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_set_state_changed_cb | ( | ma_state_changed_cb | callback, |
void * | user_data | ||
) |
Sets a state changed callback.
[in] | callback | The callback |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_set_wake_word_audio_require_flag | ( | bool | require | ) |
Sets whether multi-assistant service should send wake word audio data.
If set to true, wake word audio data will be included in audio streaming data.
The wake word is the way you initiate a conversation with your vocal assistant. It is a predefined keyword automatically detected from continuously streaming audio.
Use ma_set_audio_streaming_data_section_changed_cb() to be informed about switching between wake word and regular audio data.
[in] | require | The require value to be set |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_STATE | Invalid state |
MA_ERROR_OPERATION_FAILED | Operation failed |
int ma_set_wakeup_engine_command_cb | ( | ma_wakeup_engine_command_cb | callback, |
void * | user_data | ||
) |
Sets the wakeup engine command callback.
[in] | callback | The callback |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
MA_ERROR_INVALID_STATE | Invalid state |
Starts receiving audio streaming data.
[in] | type | The type of audio streaming data for which the streaming should be started |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
Stops receiving audio streaming data.
[in] | type | The type of audio streaming data for which the streaming should be stopped |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
int ma_unprepare | ( | void | ) |
Unprepares multi-assistant client.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_unset_active_state_changed_cb | ( | void | ) |
Unsets the active state changed callback.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_unset_audio_streaming_cb | ( | void | ) |
Unsets an audio streaming callback.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_unset_audio_streaming_data_section_changed_cb | ( | void | ) |
Unsets the section changed callback for audio streaming data.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_unset_error_cb | ( | void | ) |
Unsets an error callback.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_unset_language_changed_cb | ( | void | ) |
Unsets a language changed callback.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_unset_preprocessing_information_changed_cb | ( | void | ) |
Unsets the preprocessing information changed callback.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_unset_state_changed_cb | ( | void | ) |
Unsets a state changed callback.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_unset_wakeup_engine_command_cb | ( | void | ) |
Unsets the wakeup engine command callback.
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_INVALID_STATE | Invalid state |
int ma_update_voice_feedback_state | ( | ma_voice_feedback_state_e | state | ) |
Sends an update of the client's voice feedback state to the server.
[in] | state | The current voice feedback state |
0
on success, otherwise a negative error value MA_ERROR_NONE | Successful |
MA_ERROR_NOT_SUPPORTED | Not supported |
MA_ERROR_PERMISSION_DENIED | Permission denied |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |