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. |
Function Documentation
int ma_deinitialize | ( | void | ) |
Deinitializes multi-assistant client.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/recorder
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_PERMISSION_DENIED Permission denied MA_ERROR_INVALID_STATE Invalid state
- Postcondition:
- If this function is called, the state will be MA_STATE_NONE.
- See also:
- ma_initialize()
int ma_get_current_language | ( | char ** | language | ) |
Gets the current language of multi-assistant client.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/recorder
- Remarks:
- The language should be released using free().
- Parameters:
-
[out] language The current language
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/recorder
- Parameters:
-
[out] rate The audio sampling rate [out] channel The audio channel [out] audio_type The audio type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- Precondition:
- The state should be MA_STATE_READY.
int ma_get_state | ( | ma_state_e * | state | ) |
Gets the current state of the multi-assistant client.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/recorder
- Parameters:
-
[out] state The current state
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/recorder
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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
- Postcondition:
- If this function is called, the state will be MA_STATE_INITIALIZED.
- See also:
- ma_deinitialize()
int ma_prepare | ( | void | ) |
Prepares multi-assistant client.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/recorder
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_PERMISSION_DENIED Permission denied MA_ERROR_INVALID_STATE Invalid state
- Precondition:
- The state should be MA_STATE_INITIALIZED.
- Postcondition:
- If this function is called, the state will be MA_STATE_READY.
- See also:
- ma_unprepare()
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.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/recorder
- Parameters:
-
[in] event The ASR result event (e.g. MA_ASR_RESULT_EVENT_FINAL_RESULT) [in] asr_result The ASR result text
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/recorder
- Parameters:
-
[in] display_text The text shown on the display [in] utterance_text The utterance text [in] result_json The result data (JSON format)
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 5.0
- Parameters:
-
[in] callback The callback [in] user_data The user data passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_INVALID_STATE Invalid state MA_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The state should be MA_STATE_INITIALIZED.
int ma_set_error_cb | ( | ma_error_cb | callback, |
void * | user_data | ||
) |
Sets an error callback.
- Since :
- 5.0
- Parameters:
-
[in] callback The callback [in] user_data The user data passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_INVALID_STATE Invalid state MA_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The state should be MA_STATE_INITIALIZED.
- See also:
- ma_error_cb()
- ma_unset_errord_cb()
int ma_set_language_changed_cb | ( | ma_language_changed_cb | callback, |
void * | user_data | ||
) |
Sets a language changed callback.
- Since :
- 5.0
- Parameters:
-
[in] callback The callback [in] user_data The user data passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_INVALID_STATE Invalid state MA_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The state should be MA_STATE_INITIALIZED.
int ma_set_state_changed_cb | ( | ma_state_changed_cb | callback, |
void * | user_data | ||
) |
Sets a state changed callback.
- Since :
- 5.0
- Parameters:
-
[in] callback The callback [in] user_data The user data passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_INVALID_STATE Invalid state MA_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The state should be MA_STATE_INITIALIZED.
int ma_unprepare | ( | void | ) |
Unprepares multi-assistant client.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/recorder
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_PERMISSION_DENIED Permission denied MA_ERROR_INVALID_STATE Invalid state
- Precondition:
- The state should be MA_STATE_READY.
- Postcondition:
- If this function is called, the state will be MA_STATE_INITIALIZED.
- See also:
- ma_prepare()
int ma_unset_audio_streaming_cb | ( | void | ) |
Unsets an audio streaming callback.
- Since :
- 5.0
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_INVALID_STATE Invalid state
- Precondition:
- The state should be MA_STATE_INITIALIZED.
int ma_unset_error_cb | ( | void | ) |
Unsets an error callback.
- Since :
- 5.0
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_INVALID_STATE Invalid state
- Precondition:
- The state should be MA_STATE_INITIALIZED.
- See also:
- ma_error_cb()
- ma_set_error_cb()
int ma_unset_language_changed_cb | ( | void | ) |
Unsets a language changed callback.
- Since :
- 5.0
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_INVALID_STATE Invalid state
- Precondition:
- The state should be MA_STATE_INITIALIZED.
int ma_unset_state_changed_cb | ( | void | ) |
Unsets a state changed callback.
- Since :
- 5.0
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MA_ERROR_NONE Successful MA_ERROR_NOT_SUPPORTED Not supported MA_ERROR_INVALID_STATE Invalid state
- Precondition:
- The state should be MA_STATE_INITIALIZED.