STT_OPTION_SILENCE_DETECTION_AUTO = 2 /**< Silence detection type - Auto */
} stt_option_silence_detection_e;
+/**
+* @brief Enumeration for speech status.
+* @since_tizen 5.5
+*/
+typedef enum {
+ STT_SPEECH_STATUS_BEGINNING_OF_SPEECH_DETECTED = 0, /**< Beginning Of Speech is detected */
+ STT_SPEECH_STATUS_END_OF_SPEECH_DETECTED /**< End Of Speech is detected */
+} stt_speech_status_e;
+
/**
* @brief A structure of STT handle.
/**
* @brief Called to get the engine information.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] stt The STT handle
* @param[in] engine_id Engine ID
* @param[in] engine_name Engine name
* @param[in] user_data User data passed from the stt_setting_foreach_supported_engines()
/**
+ * @brief Called when STT engine detects beginning or ending of the speech.
+ * @since_tizen 5.5
+ * @param[in] stt The STT handle
+ * @param[in] status The speech status
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see stt_set_speech_status_cb()
+ */
+typedef void (*stt_speech_status_cb)(stt_h stt, stt_speech_status_e status, void *user_data);
+
+
+/**
* @brief Creates a STT handle.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @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().
* 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.
+ * If you call this function again before state changes, you will receive #STT_ERROR_IN_PROGRESS_TO_RECORDING.
* @see stt_stop()
* @see stt_cancel()
* @see stt_state_changed_cb()
* @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().
* If this function succeeds, the STT state will be #STT_STATE_PROCESSING.
- * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_PROCESSING.
+ * 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()
* @see stt_cancel()
* @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().
* 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.
+ * If you call this function again before state changes, you will receive #STT_ERROR_IN_PROGRESS_TO_READY.
* @see stt_start()
* @see stt_stop()
* @see stt_state_changed_cb()
/**
- * @brief Registers a callback function to get the recognition result.
+ * @brief Sets a callback function to get the recognition result.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
/**
- * @brief Unregisters the callback function.
+ * @brief Unsets the callback function.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
/**
- * @brief Registers a callback function to be called when STT state changes.
+ * @brief Sets a callback function to be called when STT state changes.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
/**
- * @brief Unregisters the callback function.
+ * @brief Unsets the callback function.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
/**
- * @brief Registers a callback function to be called when an error occurred.
+ * @brief Sets a callback function to be called when an error occurred.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
/**
- * @brief Unregisters the callback function.
+ * @brief Unsets the callback function.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
/**
- * @brief Registers a callback function to detect the default language change.
+ * @brief Sets a callback function to detect the default language change.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
/**
- * @brief Unregisters the callback function.
+ * @brief Unsets the callback function.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
/**
- * @brief Registers a callback function to detect the engine change.
+ * @brief Sets 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
/**
- * @brief Unregisters the callback function.
+ * @brief Unsets the callback function.
* @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
* @param[in] stt The STT handle
* @return @c 0 on success,
int stt_unset_engine_changed_cb(stt_h stt);
+/**
+ * @brief Sets a callback function to detect the speech status is changed.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/recorder
+ * @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 @c 0 on success,
+ * otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @pre The state should be #STT_STATE_CREATED.
+ * @see stt_speech_status_cb()
+ * @see stt_unset_speech_status_cb()
+*/
+int stt_set_speech_status_cb(stt_h stt, stt_speech_status_cb callback, void* user_data);
+
+
+/**
+ * @brief Unsets the callback function to detect the speech status is changed.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/recorder
+ * @param[in] stt The STT handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @pre The state should be #STT_STATE_CREATED.
+ * @see stt_set_speech_status_cb()
+*/
+int stt_unset_speech_status_cb(stt_h stt);
+
+
#ifdef __cplusplus
}
#endif
{
#endif
-#define STT_SPEECH_STATUS_BEGINNING_POINT_DETECTED 0
/**
* @brief Enumerations of audio type.
} stt_audio_type_e;
/**
- * @brief Called when user speaking is detected.
- *
- * @param[in] stt The STT handle
- * @param[in] status The speech status
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @pre An application registers callback function using stt_set_speech_status_cb().
- *
- * @see stt_set_speech_status_cb()
- * @see stt_unset_speech_status_cb()
- */
-typedef void (*stt_speech_status_cb)(stt_h stt, int status, void *user_data);
-
-
-/**
- * @brief Registers a callback function to detect the speech status is changed.
- * @since_tizen 3.0
- * @privilege %http://tizen.org/privilege/recorder
- *
- * @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
- * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
- *
- * @pre The state should be #STT_STATE_CREATED.
- *
- * @see stt_speech_status_cb()
- * @see stt_unset_speech_status_cb()
-*/
-int stt_set_speech_status_cb(stt_h stt, stt_speech_status_cb callback, void* user_data);
-
-/**
- * @brief Unregisters the callback function.
- * @since_tizen 3.0
- * @privilege %http://tizen.org/privilege/recorder
- *
- * @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
- * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
- *
- * @pre The state should be #STT_STATE_CREATED.
- *
- * @see stt_set_speech_status_cb()
-*/
-int stt_unset_speech_status_cb(stt_h stt);
-
-/**
* @brief Sets server STT.
* @details Using this API, the application can set server STT with a @a key as a @a user_data
* The key is a private data to set STT server.