Tizen Native API  7.0
Multi assistant client

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)
 Updates the state of client's voice feedback to the server.
int ma_send_assistant_specific_command (const char *command)
 Sends an 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 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_set_assistant_wakeup_language (const char *language)
 Sets the language configuration for wake word detection.
int ma_set_service_state_changed_cb (ma_service_state_changed_cb callback, void *user_data)
 Sets the service state changed callback.
int ma_unset_service_state_changed_cb (void)
 Unsets the service state changed callback.
int ma_set_voice_key_status_changed_cb (ma_voice_key_status_changed_cb callback, void *user_data)
 Sets a voice key status changed callback.
int ma_unset_voice_key_status_changed_cb (void)
 Unsets a voice key status changed callback.
int ma_add_wake_word (const char *wake_word, const char *language)
 Adds a group of wake words for activating assistant.
int ma_remove_wake_word (const char *wake_word, const char *language)
 Removes a group of wake words for activating assistant.
int ma_get_wakeup_info_wake_word (char **wake_word)
 Retrieves wake word information of the last wakeup event.
int ma_get_wakeup_info_extra_data (unsigned char **extra_data, int *extra_data_length, char **extra_data_desc)
 Retrieves extra data information of the last wakeup event.

Function Documentation

int ma_add_wake_word ( const char *  wake_word,
const char *  language 
)

Adds a group of wake words for activating assistant.

A <word, language> pair with the same word and the different language identifies a different operation. For example, <"Hi Tizen", "en_US"> and <"Hi Tizen", "en_GB"> will operate differently. When the wake up language is set to "en_GB", although <"Hi Tizen", "en_US"> is added, then "Hi Tizen" won't wake up the Tizen voice assistant. <"Hi Tizen", "en_GB"> have to be added for this use case.
Adding the same word twice does not return any errors.

Since :
6.0
Parameters:
[in]wake_wordThe wake word to be added to the list of wake words
[in]languageThe language code for which the word will be added. The language is identified by its code (e.g. "en_US").
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
MA_ERROR_OPERATION_FAILEDOperation failed
Precondition:
The state should be MA_STATE_READY.
int ma_assistant_info_foreach_assistants ( ma_assistant_info_list_cb  callback,
void *  user_data 
)

Retrieves the information about all installed voice assistant applications.

Since :
5.5
Parameters:
[in]callbackThe callback for getting the information of installed assistants.
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
See also:
ma_assistant_info_list_cb()
int ma_assistant_info_get_app_id ( ma_assistant_info_h  handle,
char **  app_id 
)

Gets the app id of the specified handle.

Since :
5.5
Remarks:
You must not release app_id using free().
Parameters:
[in]handleThe handle to the assistant's information
[out]app_idThe application ID of the given assistant handle
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
int ma_assistant_info_get_enabled_status ( ma_assistant_info_h  handle,
bool *  status 
)

Gets the enabled status of the specified handle.

Since :
5.5
Parameters:
[in]handleThe handle to the assistant's information
[out]statusThe enable status of the given assistant handle
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
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_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_STATEInvalid 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]languageThe current language
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid 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]rateThe audio sampling rate
[out]channelThe audio channel
[out]audio_typeThe audio type
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
MA_ERROR_OPERATION_FAILEDOperation failed
Precondition:
The state should be MA_STATE_READY.
int ma_get_recording_audio_source_type ( char **  type)

Gets the recording audio source type.

Since :
5.5
Remarks:
You must release type using free().
Parameters:
[out]typeThe audio source type
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
MA_ERROR_OPERATION_FAILEDOperation 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]stateThe current state
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
int ma_get_wakeup_info_extra_data ( unsigned char **  extra_data,
int *  extra_data_length,
char **  extra_data_desc 
)

Retrieves extra data information of the last wakeup event.

When required, wakeup engine adds extra data information that can be processed by the voice assistant. The information MUST be defined by both wakeup engine and voice assistant.

Since :
7.0
Remarks:
You must release extra_data and extra_data_desc using free(). extra_data can be changed whenever ma_active_state_changed_cb() is called.
Parameters:
[out]extra_dataThe extra data information, if exists.
[out]extra_data_lengthThe length of extra data.
[out]extra_data_descThe string value describing the type of extra data.
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
MA_ERROR_OPERATION_FAILEDOperation failed
Precondition:
The state should be MA_STATE_READY.
See also:
ma_active_state_changed_cb()
int ma_get_wakeup_info_wake_word ( char **  wake_word)

Retrieves wake word information of the last wakeup event.

Since :
7.0
Remarks:
You must release wake_word using free(). wake_word can be changed whenever ma_active_state_changed_cb() is called.
Parameters:
[out]wake_wordThe wake word information, if exists.
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
MA_ERROR_OPERATION_FAILEDOperation failed
Precondition:
The state should be MA_STATE_READY.
See also:
ma_active_state_changed_cb()
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_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_OPERATION_FAILEDOperation failed
MA_ERROR_OUT_OF_MEMORYOut 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_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_STATEInvalid 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_remove_wake_word ( const char *  wake_word,
const char *  language 
)

Removes a group of wake words for activating assistant.

A <word, language> pair with the same word and the different language identifies a different operation. For example, <"Hi Tizen", "en_US"> and <"Hi Tizen", "en_GB"> will operate differently. Removing an unregistered word doesn't return any errors.

Since :
6.0
Parameters:
[in]wake_wordThe wake word to be removed from the list of wake words
[in]languageThe language code for which the word will be removed. The language is identified by its code (e.g. "en_US").
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
MA_ERROR_OPERATION_FAILEDOperation failed
Precondition:
The state should be MA_STATE_READY.
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]eventThe ASR result event (e.g. MA_ASR_RESULT_EVENT_FINAL_RESULT)
[in]asr_resultThe ASR result text
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid parameter
int ma_send_assistant_specific_command ( const char *  command)

Sends an assistant-specific command to the server.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/recorder
Parameters:
[in]commandThe command to be sent to the server
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid parameter
int ma_send_preprocessing_result ( bool  is_success)

Sends the preprocessing result.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/recorder
Parameters:
[in]is_successThe result value to be sent, indicating whether the preprocessing succeeded or not
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_STATEInvalid state
MA_ERROR_OPERATION_FAILEDOperation failed
Precondition:
The state should be MA_STATE_READY.

Sends recognition result to the multi-assistant service.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/recorder
Parameters:
[in]resultThe recognition result
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid 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_textThe text shown on the display
[in]utterance_textThe utterance text
[in]result_jsonThe result data (JSON format)
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid parameter
int ma_set_active_state_changed_cb ( ma_active_state_changed_cb  callback,
void *  user_data 
)

Sets the active state changed callback.

Since :
5.5
Parameters:
[in]callbackThe callback
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_active_state_changed_cb()
ma_unset_active_state_changed_cb()
int ma_set_assistant_wakeup_language ( const char *  language)

Sets the language configuration for wake word detection.

The language configuration of the assistant that invoked this function will be changed and language configurations of other assistants will remain unchanged.

Since :
6.0
Parameters:
[in]languageThe language configuration that will be used for wake word detection. It should be denoted by two-letter code defined by ISO 639-1, optionally combined with two-letter code defined by ISO 3166. For example, "ko_KR" for Korean, "en_US" for American English.
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_READY.
int ma_set_audio_streaming_cb ( ma_audio_streaming_cb  callback,
void *  user_data 
)

Sets an audio streaming callback.

Since :
5.0
Parameters:
[in]callbackThe callback
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_audio_streaming_cb()
ma_unset_audio_streaming_cb()

Sets the section changed callback for audio streaming data.

Since :
5.5
Parameters:
[in]callbackThe callback
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_audio_streaming_data_section_changed_cb()
ma_unset_audio_streaming_data_section_changed_cb()
int ma_set_background_volume ( double  ratio)

Sets the background volume.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/volume.set
Remarks:
The ratio must be a value between 0.0 and 1.0 (inclusive).
Parameters:
[in]ratioThe volume ratio to be set
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
MA_ERROR_OPERATION_FAILEDOperation failed
Precondition:
The state should be MA_STATE_READY.
int ma_set_error_cb ( ma_error_cb  callback,
void *  user_data 
)

Sets an error callback.

Since :
5.0
Parameters:
[in]callbackThe callback
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_error_cb()
ma_unset_error_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]callbackThe callback
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_language_changed_cb()
ma_unset_language_changed_cb()
int ma_set_preprocessing_allow_mode ( ma_preprocessing_allow_mode_e  mode,
const char *  app_id 
)

Sets the preprocessing allow mode.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/recorder
Remarks:
If the app_id is NULL, allow mode will be applied regardless of app_id.
Parameters:
[in]modeThe preprocessing allow mode to be set
[in]app_idThe application ID of the assistant to perform preprocessing
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_STATEInvalid state
MA_ERROR_OPERATION_FAILEDOperation failed
Precondition:
The state should be MA_STATE_READY.

Sets the preprocessing information changed callback.

Since :
5.5
Parameters:
[in]callbackThe callback
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_preprocessing_information_changed_cb()
ma_unset_preprocessing_information_changed_cb()
int ma_set_service_state_changed_cb ( ma_service_state_changed_cb  callback,
void *  user_data 
)

Sets the service state changed callback.

Since :
6.0
Parameters:
[in]callbackThe callback
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_service_state_changed_cb()
ma_unset_service_state_changed_cb()
int ma_set_state_changed_cb ( ma_state_changed_cb  callback,
void *  user_data 
)

Sets a state changed callback.

Since :
5.0
Parameters:
[in]callbackThe callback
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_state_changed_cb()
ma_unset_state_changed_cb()
int ma_set_voice_key_status_changed_cb ( ma_voice_key_status_changed_cb  callback,
void *  user_data 
)

Sets a voice key status changed callback.

Since :
6.0
Parameters:
[in]callbackThe callback
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_voice_key_status_changed_cb()
ma_unset_voice_key_status_changed_cb()
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.

Since :
5.5
Parameters:
[in]requireThe require value to be set
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
MA_ERROR_OPERATION_FAILEDOperation failed
Precondition:
The state should be MA_STATE_READY.
int ma_set_wakeup_engine_command_cb ( ma_wakeup_engine_command_cb  callback,
void *  user_data 
)

Sets the wakeup engine command callback.

The wakeup engine command callback will be called when the wakeup engine sends wakeup engine specific command to the voice assistant. The command MUST be defined by both wakeup engine and voice assistant.

Since :
5.5
Parameters:
[in]callbackThe callback
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_PARAMETERInvalid parameter
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_wakeup_engine_command_cb()
ma_unset_wakeup_engine_command_cb()

Starts receiving audio streaming data.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/recorder
Parameters:
[in]typeThe type of audio data to start streaming
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid parameter

Stops receiving audio streaming data.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/recorder
Parameters:
[in]typeThe type of audio data to stop streaming
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid parameter
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_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_STATEInvalid 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()

Unsets the active state changed callback.

Since :
5.5
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_active_state_changed_cb()
ma_set_active_state_changed_cb()

Unsets an audio streaming callback.

Since :
5.0
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_audio_streaming_cb()
ma_set_audio_streaming_cb()

Unsets the section changed callback for audio streaming data.

Since :
5.5
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_audio_streaming_data_section_changed_cb()
ma_set_audio_streaming_data_section_changed_cb()
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_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_error_cb()
ma_set_error_cb()

Unsets a language changed callback.

Since :
5.0
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_language_changed_cb()
ma_set_language_changed_cb()

Unsets the preprocessing information changed callback.

Since :
5.5
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_preprocessing_information_changed_cb()
ma_set_preprocessing_information_changed_cb()

Unsets the service state changed callback.

Since :
6.0
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_service_state_changed_cb()
ma_set_service_state_changed_cb()
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_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_state_changed_cb()
ma_set_state_changed_cb()

Unsets a voice key status changed callback.

Since :
6.0
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_set_voice_key_status_changed_cb()
ma_voice_key_status_changed_cb()

Unsets the callback.

Since :
5.5
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_INVALID_STATEInvalid state
Precondition:
The state should be MA_STATE_INITIALIZED.
See also:
ma_wakeup_engine_command_cb()
ma_set_wakeup_engine_command_cb()

Updates the state of client's voice feedback to the server.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/recorder
Parameters:
[in]stateThe current state of voice feedback
Returns:
0 on success, otherwise a negative error value
Return values:
MA_ERROR_NONESuccessful
MA_ERROR_NOT_SUPPORTEDNot supported
MA_ERROR_PERMISSION_DENIEDPermission denied
MA_ERROR_INVALID_PARAMETERInvalid parameter