Tizen Native API
5.0
|
The Multi assistant client API provides functions for getting queries from multi assistant service and sending responses.
Copyright (c) 2011-2018 Samsung Electronics Co., Ltd All Rights Reserved
Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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_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_STATE | Invalid state |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
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_STATE | Invalid state |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
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_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_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_STATE | Invalid state |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
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_STATE | Invalid state |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
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_STATE | Invalid state |
MA_ERROR_INVALID_PARAMETER | Invalid parameter |
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_STATE | Invalid state |
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_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_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_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 |