From f0f723d99590d0786e7e03d17e8212d27a437167 Mon Sep 17 00:00:00 2001 From: Dongyeol Lee Date: Tue, 21 Aug 2012 17:47:19 +0900 Subject: [PATCH] Update stt-api for tizen 2.0 beta --- AUTHORS | 2 +- CMakeLists.txt | 0 capi-uix-stt.pc.in | 0 debian/changelog | 30 +++++++++-- debian/control | 0 debian/rules | 0 include/stt.h | 124 ++++++++++++++++++++++++++++++++++++-------- packaging/capi-uix-stt.spec | 2 +- 8 files changed, 132 insertions(+), 26 deletions(-) mode change 100755 => 100644 CMakeLists.txt mode change 100755 => 100644 capi-uix-stt.pc.in mode change 100755 => 100644 debian/changelog mode change 100755 => 100644 debian/control mode change 100755 => 100644 debian/rules diff --git a/AUTHORS b/AUTHORS index a228ba0..560e0b9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,2 @@ junghyuk park - +Dongyeol Lee diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/capi-uix-stt.pc.in b/capi-uix-stt.pc.in old mode 100755 new mode 100644 diff --git a/debian/changelog b/debian/changelog old mode 100755 new mode 100644 index 6ca1ddc..754815e --- a/debian/changelog +++ b/debian/changelog @@ -1,15 +1,39 @@ +capi-uix-stt (0.0.1-5) unstable; urgency=low + + * Updated API for asynchronous init + * Git: slp-source.sec.samsung.net:slp/api/stt + * Tag: capi-uix-stt_0.0.1-5 + + -- Dongyeol Lee Mon, 04 Jun 2012 17:39:56 +0900 + capi-uix-stt (0.0.1-4) unstable; urgency=low * Updated build configuration - * Git: api/stt + * Git: slp-source.sec.samsung.net:slp/api/stt * Tag: capi-uix-stt_0.0.1-4 -- Junghyuk Park Mon, 19 Mar 2012 21:28:33 +0900 capi-uix-stt (0.0.1-3) unstable; urgency=low - * 1.0 release. - * Git: api/stt + * Add error code + * Git: slp-source.sec.samsung.net:slp/api/stt * Tag: capi-uix-stt_0.0.1-3 + -- Dongyeol Lee Mon, 19 Mar 2012 13:55:40 +0900 + +capi-uix-stt (0.0.1-2) unstable; urgency=low + + * Update API for result message. + * Git: slp-source.sec.samsung.net:slp/api/stt + * Tag: capi-uix-stt_0.0.1-2 + + -- Dongyeol Lee Fri, 09 Mar 2012 15:05:50 +0900 + +capi-uix-stt (0.0.1-1) unstable; urgency=low + + * Initial release. + * Git: slp-source.sec.samsung.net:slp/api/stt + * Tag: capi-uix-stt_0.0.1-1 + -- Dongyeol Lee Wed, 01 Feb 2012 15:47:10 +0900 diff --git a/debian/control b/debian/control old mode 100755 new mode 100644 diff --git a/debian/rules b/debian/rules old mode 100755 new mode 100644 diff --git a/include/stt.h b/include/stt.h index efc12f5..6eae626 100644 --- a/include/stt.h +++ b/include/stt.h @@ -207,12 +207,31 @@ typedef enum { * @brief Enumerations of state. */ typedef enum { - STT_STATE_READY = 0, /**< 'READY' state */ + STT_STATE_CREATED = 0, /**< 'CREATED' state */ + STT_STATE_READY, /**< 'READY' state */ STT_STATE_RECORDING, /**< 'RECORDING' state */ STT_STATE_PROCESSING /**< 'PROCESSING' state*/ }stt_state_e; /** +* @brief Enumerations of profanity type. +*/ +typedef enum { + STT_OPTION_PROFANITY_FALSE = 0, /**< Profanity type - False */ + STT_OPTION_PROFANITY_TRUE = 1, /**< Profanity type - True */ + STT_OPTION_PROFANITY_AUTO = 2 /**< Profanity type - Auto */ +}stt_option_profanity_e; + +/** +* @brief Enumerations of punctuation type. +*/ +typedef enum { + STT_OPTION_PUNCTUATION_FALSE = 0, /**< Punctuation type - False */ + STT_OPTION_PUNCTUATION_TRUE = 1, /**< Punctuation type - True */ + STT_OPTION_PUNCTUATION_AUTO = 2 /**< Punctuation type - Auto */ +}stt_option_punctuation_e; + +/** * @brief Enumerations of silence detection type. */ typedef enum { @@ -276,10 +295,6 @@ typedef void (*stt_partial_result_cb)(stt_h stt, const char* data, void *user_da * * @pre An application registers this callback using stt_set_state_changed_cb() to detect changing state. * -* @see stt_start() -* @see stt_stop() -* @see stt_cancel() -* @see stt_result_cb() * @see stt_set_state_changed_cb() * @see stt_unset_state_changed_cb() */ @@ -304,8 +319,8 @@ typedef void (*stt_error_cb)(stt_h stt, stt_error_e reason, void *user_data); * * @param[in] stt The handle for STT * @param[in] language A language is specified as an ISO 3166 alpha-2 two letter country-code \n -* followed by ISO 639-1 for the two-letter language code. \n -* For example, "ko_KR" for Korean, "en_US" for American English. +* followed by ISO 639-1 for the two-letter language code. \n +* For example, "ko_KR" for Korean, "en_US" for American English. * @param[in] user_data The user data passed from the foreach function * * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop. @@ -317,24 +332,23 @@ typedef bool(*stt_supported_language_cb)(stt_h stt, const char* language, void* /** -* @brief Creates a handle for STT and connects daemon. +* @brief Creates a handle for STT. * * @param[out] stt The handle for STT * * @return 0 on success, otherwise a negative error value * @retval #STT_ERROR_NONE Successful -* @retval #STT_ERROR_TIMED_OUT The daemon is blocked or do not exist -* @retval #STT_ERROR_ENGINE_NOT_FOUND No available engine \n Engine should be installed * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter -* @retval #STT_ERROR_OUT_OF_MEMORY Out of memory * @retval #STT_ERROR_OPERATION_FAILED Operation failure * +* @post If this function is called, the STT state will be #STT_STATE_CREATED. +* * @see stt_destroy() */ int stt_create(stt_h* stt); /** -* @brief Destroys the handle and disconnects the daemon. +* @brief Destroys the handle. * * @param[in] stt The handle for STT * @@ -347,6 +361,40 @@ int stt_create(stt_h* stt); int stt_destroy(stt_h stt); /** +* @brief Connects the daemon. +* +* @param[in] stt The handle for 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_INVALID_STATE Invalid state +* +* @pre The state should be #STT_STATE_CREATED. +* @post If this function is called, the STT state will be #STT_STATE_READY. +* +* @see stt_unprepare() +*/ +int stt_prepare(stt_h stt); + +/** +* @brief Disconnects the daemon. +* +* @param[in] stt The handle for 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_INVALID_STATE Invalid state +* +* @pre The state should be #STT_STATE_READY. +* @post If this function is called, the STT state will be #STT_STATE_CREATED. +* +* @see stt_prepare() +*/ +int stt_unprepare(stt_h stt); + +/** * @brief Retrieves all supported languages of current engine using callback function. * * @param[in] stt The handle for STT @@ -374,8 +422,8 @@ int stt_foreach_supported_languages(stt_h stt, stt_supported_language_cb callbac * * @param[in] stt The handle for STT * @param[out] language A language is specified as an ISO 3166 alpha-2 two letter country-code \n -* followed by ISO 639-1 for the two-letter language code. \n -* For example, "ko_KR" for Korean, "en_US" for American English. +* followed by ISO 639-1 for the two-letter language code. \n +* For example, "ko_KR" for Korean, "en_US" for American English. * * @return 0 on success, otherwise a negative error value * @retval #STT_ERROR_NONE Successful @@ -426,6 +474,38 @@ int stt_get_state(stt_h stt, stt_state_e* state); int stt_is_partial_result_supported(stt_h stt, bool* partial_result); /** +* @brief Sets profanity filter. +* +* @param[in] stt The handle for STT +* @param[in] type The option type +* +* @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_FEATURE Not supported feature of current engine +* +* @pre The state should be #STT_STATE_READY. +*/ +int stt_set_profanity_filter(stt_h stt, stt_option_profanity_e type); + +/** +* @brief Sets punctuation override. +* +* @param[in] stt The handle for STT +* @param[in] type The option type +* +* @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_FEATURE Not supported feature of current engine +* +* @pre The state should be #STT_STATE_READY. +*/ +int stt_set_punctuation_override(stt_h stt, stt_option_punctuation_e type); + +/** * @brief Sets silence detection. * * @param[in] stt The handle for STT @@ -550,7 +630,7 @@ int stt_get_recording_volume(stt_h stt, float* volume); * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #STT_ERROR_INVALID_STATE Invalid state * -* @pre The state should be #STT_STATE_READY. +* @pre The state should be #STT_STATE_CREATED. * * @see stt_result_cb() * @see stt_unset_result_cb() @@ -567,7 +647,7 @@ int stt_set_result_cb(stt_h stt, stt_result_cb callback, void* user_data); * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #STT_ERROR_INVALID_STATE Invalid state * -* @pre The state should be #STT_STATE_READY. +* @pre The state should be #STT_STATE_CREATED. * * @see stt_set_result_cb() */ @@ -585,6 +665,8 @@ int stt_unset_result_cb(stt_h stt); * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #STT_ERROR_INVALID_STATE Invalid state * +* @pre The state should be #STT_STATE_CREATED. +* * @see stt_partial_result_cb() * @see stt_unset_partial_result_cb() */ @@ -600,7 +682,7 @@ int stt_set_partial_result_cb(stt_h stt, stt_partial_result_cb callback, void* u * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #STT_ERROR_INVALID_STATE Invalid state * -* @pre The state should be #STT_STATE_READY. +* @pre The state should be #STT_STATE_CREATED. * * @see stt_set_partial_result_cb() */ @@ -618,7 +700,7 @@ int stt_unset_partial_result_cb(stt_h stt); * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #STT_ERROR_INVALID_STATE Invalid state * -* @pre The state should be #STT_STATE_READY. +* @pre The state should be #STT_STATE_CREATED. * * @see stt_state_changed_cb() * @see stt_unset_state_changed_cb() @@ -635,7 +717,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 * -* @pre The state should be #STT_STATE_READY. +* @pre The state should be #STT_STATE_CREATED. * * @see stt_set_state_changed_cb() */ @@ -653,7 +735,7 @@ int stt_unset_state_changed_cb(stt_h stt); * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #STT_ERROR_INVALID_STATE Invalid state * -* @pre The state should be #STT_STATE_READY. +* @pre The state should be #STT_STATE_CREATED. * * @see stt_error_cb() * @see stt_unset_error_cb() @@ -670,7 +752,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 * -* @pre The state should be #STT_STATE_READY. +* @pre The state should be #STT_STATE_CREATED. * * @see stt_set_error_cb() */ diff --git a/packaging/capi-uix-stt.spec b/packaging/capi-uix-stt.spec index 6079fa1..66ea3f4 100644 --- a/packaging/capi-uix-stt.spec +++ b/packaging/capi-uix-stt.spec @@ -1,7 +1,7 @@ Name: capi-uix-stt Summary: A Speech To Text Library in Tizen C API Version: 0.0.1 -Release: 4 +Release: 2 Group: TO_BE/FILLED_IN License: TO BE FILLED IN Source0: %{name}-%{version}.tar.gz -- 2.7.4