Add bux2ctl_get for getting buxton key and setting an engine by users
[platform/core/uifw/stt.git] / include / stt.h
index cb5fb23..853d961 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2016 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.
@@ -38,20 +38,26 @@ extern "C"
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
 */
 typedef enum {
-       STT_ERROR_NONE                  = TIZEN_ERROR_NONE,             /**< Successful */
-       STT_ERROR_OUT_OF_MEMORY         = TIZEN_ERROR_OUT_OF_MEMORY,    /**< Out of Memory */
-       STT_ERROR_IO_ERROR              = TIZEN_ERROR_IO_ERROR,         /**< I/O error */
-       STT_ERROR_INVALID_PARAMETER     = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
-       STT_ERROR_TIMED_OUT             = TIZEN_ERROR_TIMED_OUT,        /**< No answer from the daemon */
-       STT_ERROR_RECORDER_BUSY         = TIZEN_ERROR_RESOURCE_BUSY,    /**< Device or resource busy */
-       STT_ERROR_OUT_OF_NETWORK        = TIZEN_ERROR_NETWORK_DOWN,     /**< Network is down */
-       STT_ERROR_PERMISSION_DENIED     = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
-       STT_ERROR_NOT_SUPPORTED         = TIZEN_ERROR_NOT_SUPPORTED,    /**< STT NOT supported */
-       STT_ERROR_INVALID_STATE         = TIZEN_ERROR_STT | 0x01,       /**< Invalid state */
-       STT_ERROR_INVALID_LANGUAGE      = TIZEN_ERROR_STT | 0x02,       /**< Invalid language */
-       STT_ERROR_ENGINE_NOT_FOUND      = TIZEN_ERROR_STT | 0x03,       /**< No available engine  */
-       STT_ERROR_OPERATION_FAILED      = TIZEN_ERROR_STT | 0x04,       /**< Operation failed  */
-       STT_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_STT | 0x05        /**< Not supported feature of current engine */
+       STT_ERROR_NONE                          = TIZEN_ERROR_NONE,             /**< Successful */
+       STT_ERROR_OUT_OF_MEMORY                 = TIZEN_ERROR_OUT_OF_MEMORY,    /**< Out of Memory */
+       STT_ERROR_IO_ERROR                      = TIZEN_ERROR_IO_ERROR,         /**< I/O error */
+       STT_ERROR_INVALID_PARAMETER             = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
+       STT_ERROR_TIMED_OUT                     = TIZEN_ERROR_TIMED_OUT,        /**< No answer from the STT service */
+       STT_ERROR_RECORDER_BUSY                 = TIZEN_ERROR_RESOURCE_BUSY,    /**< Device or resource busy */
+       STT_ERROR_OUT_OF_NETWORK                = TIZEN_ERROR_NETWORK_DOWN,     /**< Network is down */
+       STT_ERROR_PERMISSION_DENIED             = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
+       STT_ERROR_NOT_SUPPORTED                 = TIZEN_ERROR_NOT_SUPPORTED,    /**< STT NOT supported */
+       STT_ERROR_INVALID_STATE                 = TIZEN_ERROR_STT | 0x01,       /**< Invalid state */
+       STT_ERROR_INVALID_LANGUAGE              = TIZEN_ERROR_STT | 0x02,       /**< Invalid language */
+       STT_ERROR_ENGINE_NOT_FOUND              = TIZEN_ERROR_STT | 0x03,       /**< No available engine  */
+       STT_ERROR_OPERATION_FAILED              = TIZEN_ERROR_STT | 0x04,       /**< Operation failed  */
+       STT_ERROR_NOT_SUPPORTED_FEATURE         = TIZEN_ERROR_STT | 0x05,       /**< Not supported feature of current engine */
+       STT_ERROR_RECORDING_TIMED_OUT           = TIZEN_ERROR_STT | 0x06,       /**< Recording timed out @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
+       STT_ERROR_NO_SPEECH                     = TIZEN_ERROR_STT | 0x07,       /**< No speech while recording @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
+       STT_ERROR_IN_PROGRESS_TO_READY          = TIZEN_ERROR_STT | 0x08,       /**< Progress to ready is not finished @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
+       STT_ERROR_IN_PROGRESS_TO_RECORDING      = TIZEN_ERROR_STT | 0x09,       /**< Progress to recording is not finished @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
+       STT_ERROR_IN_PROGRESS_TO_PROCESSING     = TIZEN_ERROR_STT | 0x10,       /**< Progress to processing is not finished @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
+       STT_ERROR_SERVICE_RESET                 = TIZEN_ERROR_STT | 0x11        /**< Service reset @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
 } stt_error_e;
 
 /**
@@ -296,6 +302,24 @@ typedef void (*stt_default_language_changed_cb)(stt_h stt, const char* previous_
                                                const char* current_language, void* user_data);
 
 /**
+ * @brief Called when the engine is changed.
+ * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
+ *
+ * @remarks The language is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code. For example, "ko_KR" for Korean, "en_US" for American English.
+ *
+ * @param[in] stt The STT handle
+ * @param[in] engine_id Engine id
+ * @param[in] language The default language
+ * @param[in] support_silence Whether the silence detection is supported or not
+ * @param[in] need_credential The necessity of credential
+ * @param[in] user_data The user data passed from the callback registration function
+ *
+ * @see stt_set_engine_changed_cb()
+*/
+typedef void (*stt_engine_changed_cb)(stt_h stt, const char* engine_id, const char* language,
+                                               bool support_silence, bool need_credential, void* user_data);
+
+/**
  * @brief Creates a STT handle.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
@@ -311,6 +335,7 @@ typedef void (*stt_default_language_changed_cb)(stt_h stt, const char* previous_
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @post If this function is called, the STT state will be #STT_STATE_CREATED.
  *
@@ -331,6 +356,7 @@ int stt_create(stt_h* stt);
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @see stt_create()
 */
@@ -352,6 +378,7 @@ int stt_destroy(stt_h stt);
  * @retval #STT_ERROR_INVALID_STATE STT Not initialized
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  * @post This function invokes stt_supported_engine_cb() repeatedly for getting engine information.
@@ -377,6 +404,7 @@ int stt_foreach_supported_engines(stt_h stt, stt_supported_engine_cb callback, v
  * @retval #STT_ERROR_INVALID_STATE STT Not initialized
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  *
@@ -389,6 +417,7 @@ int stt_get_engine(stt_h stt, char** engine_id);
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/recorder
+ * @privilege %http://tizen.org/privilege/appmanager.launch
  *
  * @param[in] stt The STT handle
  * @param[in] engine_id Engine id
@@ -399,6 +428,7 @@ int stt_get_engine(stt_h stt, char** engine_id);
  * @retval #STT_ERROR_INVALID_STATE STT Not initialized
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  *
@@ -407,7 +437,89 @@ int stt_get_engine(stt_h stt, char** engine_id);
 int stt_set_engine(stt_h stt, const char* engine_id);
 
 /**
- * @brief Connects the daemon asynchronously.
+ * @brief Sets the app credential.
+ * @details Using this API, the application can set a credential.
+ *     The credential is a key to verify the authorization about using the engine.
+ *     If the application sets the credential, it will be able to use functions of the engine entirely.
+ * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
+ *
+ * @remarks The necessity of the credential depends on the engine. In case of the engine which is basically embedded in Tizen, the credential is not necessary so far.
+ *     However, if the user wants to apply the 3rd party's engine, the credential may be necessary. In that case, please follow the policy provided by the corresponding engine.
+ *
+ * @param[in] stt The STT handle
+ * @param[in] credential The app credential
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #STT_ERROR_NONE Success
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ *
+ * @pre The state should be #STT_STATE_CREATED or #STT_STATE_READY.
+ *
+ * @see stt_start()
+*/
+
+int stt_set_credential(stt_h stt, const char* credential);
+
+/**
+ * @brief Sets the private data to stt engine.
+ * @details The private data is the setting parameter for applying keys provided by the engine.
+ *     Using this API, the application can set the private data and use the corresponding key of the engine.
+ *     For example, if the engine provides 'partial recognition' as a recognition type, the application can set the private data as the following. \n
+ *     int ret = stt_set_private_data(stt_h, "recognition_type", "PARTIAL");
+ *
+ * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
+ *
+ * @remarks If the engine is replaced with the other engine, the key may be ignored.
+ *
+ * @param[in] stt The STT handle
+ * @param[in] key The field name of private data
+ * @param[in] data The data for set
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_TIMED_OUT No answer from the STT service
+ *
+ * @pre The state should be #STT_STATE_READY.
+ *
+ * @see stt_get_private_data()
+*/
+int stt_set_private_data(stt_h stt, const char* key, const char* data);
+
+/**
+ * @brief Gets the private data from stt engine.
+ * @details The private data is the information provided by the engine.
+ *     Using this API, the application can get the private data which corresponds to the key from the engine.
+
+ * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
+ *
+ * @remarks If the engine is replaced with the other engine, the key may be ignored.
+ *
+ * @param[in] stt The STT handle
+ * @param[in] key The field name of private data
+ * @param[out] data The data field of private data
+ *
+ * @remarks The @a data must be released using free() when it is no longer required.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_TIMED_OUT No answer from the STT service
+ *
+ * @pre The state should be #STT_STATE_READY.
+ *
+ * @see stt_set_private_data()
+*/
+int stt_get_private_data(stt_h stt, const char* key, char** data);
+
+/**
+ * @brief Connects the STT service asynchronously.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/recorder
@@ -419,6 +531,7 @@ int stt_set_engine(stt_h stt, const char* engine_id);
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  * @post If this function is successful, the STT state will be #STT_STATE_READY. \n
@@ -429,7 +542,7 @@ int stt_set_engine(stt_h stt, const char* engine_id);
 int stt_prepare(stt_h stt);
 
 /**
- * @brief Disconnects the daemon.
+ * @brief Disconnects the STT service.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/recorder
@@ -441,6 +554,7 @@ int stt_prepare(stt_h stt);
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_READY.
  * @post If this function is called, the STT state will be #STT_STATE_CREATED.
@@ -462,9 +576,11 @@ int stt_unprepare(stt_h stt);
  * @return 0 on success, otherwise a negative error value
  * @retval #STT_ERROR_NONE Successful
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_ENGINE_NOT_FOUND No available engine
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @post This function invokes stt_supported_language_cb() repeatedly for getting languages.
  *
@@ -490,6 +606,7 @@ int stt_foreach_supported_languages(stt_h stt, stt_supported_language_cb callbac
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @see stt_foreach_supported_languages()
 */
@@ -508,6 +625,7 @@ int stt_get_default_language(stt_h stt, char** language);
  * @retval #STT_ERROR_NONE Successful
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @see stt_start()
  * @see stt_stop()
@@ -517,6 +635,26 @@ int stt_get_default_language(stt_h stt, char** language);
 int stt_get_state(stt_h stt, stt_state_e* state);
 
 /**
+ * @brief Gets the current error message.
+ * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
+ * @remarks This function should be called during an stt error callback. If not, the error as operation failure will be returned. \n
+ *     If the function succeeds, @a err_msg must be released using free() when it is no longer required.
+ *
+ * @param[in] stt The STT handle
+ * @param[out] err_msg The current error message
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_OPERATION_FAILED Operation failure
+ *
+ * @see stt_set_error_cb()
+ * @see stt_unset_error_cb()
+*/
+int stt_get_error_message(stt_h stt, char** err_msg);
+
+/**
  * @brief Checks whether the recognition type is supported.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
@@ -532,6 +670,7 @@ int stt_get_state(stt_h stt, stt_state_e* state);
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_READY.
 */
@@ -552,6 +691,7 @@ int stt_is_recognition_type_supported(stt_h stt, const char* type, bool* support
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED_FEATURE Not supported feature of current engine
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_READY.
 */
@@ -574,6 +714,7 @@ int stt_set_silence_detection(stt_h stt, stt_option_silence_detection_e type);
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_READY.
 */
@@ -593,6 +734,7 @@ int stt_set_start_sound(stt_h stt, const char* filename);
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_READY.
 */
@@ -615,6 +757,7 @@ int stt_unset_start_sound(stt_h stt);
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_READY.
 */
@@ -634,6 +777,7 @@ int stt_set_stop_sound(stt_h stt, const char* filename);
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_READY.
 */
@@ -645,7 +789,7 @@ int stt_unset_stop_sound(stt_h stt);
  * @privlevel public
  * @privilege %http://tizen.org/privilege/recorder
  *
- * @remarks This function starts recording in the daemon and sending recording data to engine. \n
+ * @remarks This function starts recording in the STT service and sending recording data to engine. \n
  * This work continues until stt_stop(), stt_cancel() or silence detected by engine.
  *
  * @param[in] stt The STT handle
@@ -660,10 +804,13 @@ int stt_unset_stop_sound(stt_h stt);
  * @retval #STT_ERROR_RECORDER_BUSY Recorder busy
  * @retval #STT_ERROR_INVALID_LANGUAGE Invalid language
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
  *
  * @pre The state should be #STT_STATE_READY.
  * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
  * If this function succeeds, the STT state will be #STT_STATE_RECORDING.
+ * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_RECORDING.
  *
  * @see stt_stop()
  * @see stt_cancel()
@@ -685,10 +832,15 @@ int stt_start(stt_h stt, const char* language, const char* type);
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
  *
  * @pre The state should be #STT_STATE_RECORDING.
  * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
  * If this function succeeds, the STT state will be #STT_STATE_PROCESSING. \n
+ * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_PROCESSING.
  * After processing of engine, stt_result_cb() is called.
  *
  * @see stt_start()
@@ -714,10 +866,15 @@ int stt_stop(stt_h stt);
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
  *
  * @pre The state should be #STT_STATE_RECORDING or #STT_STATE_PROCESSING.
  * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
  * If this function succeeds, the STT state will be #STT_STATE_READY.
+ * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_READY.
  *
  * @see stt_start()
  * @see stt_stop()
@@ -740,6 +897,7 @@ int stt_cancel(stt_h stt);
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_RECORDING.
  *
@@ -765,6 +923,7 @@ int stt_get_recording_volume(stt_h stt, float* volume);
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre This function should be called in stt_recognition_result_cb().
  * @post This function invokes stt_result_time_cb() repeatedly for getting time information.
@@ -789,6 +948,7 @@ int stt_foreach_detailed_result(stt_h stt, stt_result_time_cb callback, void* us
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  *
@@ -810,6 +970,7 @@ int stt_set_recognition_result_cb(stt_h stt, stt_recognition_result_cb callback,
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  *
@@ -832,6 +993,7 @@ int stt_unset_recognition_result_cb(stt_h stt);
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  *
@@ -853,6 +1015,7 @@ int stt_set_state_changed_cb(stt_h stt, stt_state_changed_cb callback, void* use
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  *
@@ -875,6 +1038,7 @@ int stt_unset_state_changed_cb(stt_h stt);
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  *
@@ -896,6 +1060,7 @@ int stt_set_error_cb(stt_h stt, stt_error_cb callback, void* user_data);
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  *
@@ -918,6 +1083,7 @@ int stt_unset_error_cb(stt_h stt);
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  *
@@ -939,6 +1105,7 @@ int stt_set_default_language_changed_cb(stt_h stt, stt_default_language_changed_
  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STT_ERROR_INVALID_STATE Invalid state
  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre The state should be #STT_STATE_CREATED.
  *
@@ -946,6 +1113,46 @@ int stt_set_default_language_changed_cb(stt_h stt, stt_default_language_changed_
 */
 int stt_unset_default_language_changed_cb(stt_h stt);
 
+/**
+ * @brief Registers a callback function to detect the engine change.
+ * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
+ *
+ * @param[in] stt The STT handle
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ *
+ * @pre The state should be #STT_STATE_CREATED.
+ *
+ * @see stt_engine_changed_cb()
+ * @see stt_unset_engine_changed_cb()
+*/
+int stt_set_engine_changed_cb(stt_h stt, stt_engine_changed_cb callback, void* user_data);
+
+/**
+ * @brief Unregisters the callback function.
+ * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
+ *
+ * @param[in] stt The STT handle
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ *
+ * @pre The state should be #STT_STATE_CREATED.
+ *
+ * @see stt_set_engine_changed_cb()
+*/
+int stt_unset_engine_changed_cb(stt_h stt);
+
+
 #ifdef __cplusplus
 }
 #endif