2 * Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
27 * @addtogroup CAPI_UIX_STT_MODULE
37 * @brief Enumerations for error codes.
38 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
41 STT_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
42 STT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of Memory */
43 STT_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
44 STT_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
45 STT_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< No answer from the STT service */
46 STT_ERROR_RECORDER_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Device or resource busy */
47 STT_ERROR_OUT_OF_NETWORK = TIZEN_ERROR_NETWORK_DOWN, /**< Network is down */
48 STT_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
49 STT_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< STT NOT supported */
50 STT_ERROR_INVALID_STATE = TIZEN_ERROR_STT | 0x01, /**< Invalid state */
51 STT_ERROR_INVALID_LANGUAGE = TIZEN_ERROR_STT | 0x02, /**< Invalid language */
52 STT_ERROR_ENGINE_NOT_FOUND = TIZEN_ERROR_STT | 0x03, /**< No available engine */
53 STT_ERROR_OPERATION_FAILED = TIZEN_ERROR_STT | 0x04, /**< Operation failed */
54 STT_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_STT | 0x05, /**< Not supported feature of current engine */
55 STT_ERROR_RECORDING_TIMED_OUT = TIZEN_ERROR_STT | 0x06, /**< Recording timed out @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
56 STT_ERROR_NO_SPEECH = TIZEN_ERROR_STT | 0x07, /**< No speech while recording @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
57 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 */
58 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 */
59 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 */
60 STT_ERROR_SERVICE_RESET = TIZEN_ERROR_STT | 0x11 /**< Service reset @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
64 * @brief Definition for free form dictation and default type.
65 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
67 #define STT_RECOGNITION_TYPE_FREE "stt.recognition.type.FREE"
70 * @brief Definition for continuous free dictation.
71 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
73 #define STT_RECOGNITION_TYPE_FREE_PARTIAL "stt.recognition.type.FREE.PARTIAL"
76 * @brief Definition for search.
77 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
79 #define STT_RECOGNITION_TYPE_SEARCH "stt.recognition.type.SEARCH"
82 * @brief Definition for web search.
83 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
85 #define STT_RECOGNITION_TYPE_WEB_SEARCH "stt.recognition.type.WEB_SEARCH"
88 * @brief Definition for map.
89 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
91 #define STT_RECOGNITION_TYPE_MAP "stt.recognition.type.MAP"
94 * @brief Definition for none message.
95 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
97 #define STT_RESULT_MESSAGE_NONE "stt.result.message.none"
100 * @brief Definition for failed recognition because the speech started too soon.
101 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
103 #define STT_RESULT_MESSAGE_ERROR_TOO_SOON "stt.result.message.error.too.soon"
106 * @brief Definition for failed recognition because the speech is too short.
107 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
109 #define STT_RESULT_MESSAGE_ERROR_TOO_SHORT "stt.result.message.error.too.short"
112 * @brief Definition for failed recognition because the speech is too long.
113 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
115 #define STT_RESULT_MESSAGE_ERROR_TOO_LONG "stt.result.message.error.too.long"
118 * @brief Definition for failed recognition because the speech is too quiet to listen.
119 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
121 #define STT_RESULT_MESSAGE_ERROR_TOO_QUIET "stt.result.message.error.too.quiet"
124 * @brief Definition for failed recognition because the speech is too loud to listen.
125 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
127 #define STT_RESULT_MESSAGE_ERROR_TOO_LOUD "stt.result.message.error.too.loud"
130 * @brief Definition for failed recognition because the speech is too fast to listen.
131 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
133 #define STT_RESULT_MESSAGE_ERROR_TOO_FAST "stt.result.message.error.too.fast"
137 * @brief Enumeration for state.
138 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
141 STT_STATE_CREATED = 0, /**< 'CREATED' state */
142 STT_STATE_READY = 1, /**< 'READY' state */
143 STT_STATE_RECORDING = 2, /**< 'RECORDING' state */
144 STT_STATE_PROCESSING = 3 /**< 'PROCESSING' state*/
148 * @brief Enumeration for result event.
149 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
152 STT_RESULT_EVENT_FINAL_RESULT = 0, /**< Event when the recognition full or last result is ready */
153 STT_RESULT_EVENT_PARTIAL_RESULT, /**< Event when the recognition partial result is ready */
154 STT_RESULT_EVENT_ERROR /**< Event when the recognition has failed */
155 } stt_result_event_e;
158 * @brief Enumeration for result time callback event.
159 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
162 STT_RESULT_TIME_EVENT_BEGINNING = 0, /**< Event when the token is beginning type */
163 STT_RESULT_TIME_EVENT_MIDDLE = 1, /**< Event when the token is middle type */
164 STT_RESULT_TIME_EVENT_END = 2 /**< Event when the token is end type */
165 } stt_result_time_event_e;
168 * @brief Enumeration for silence detection type.
169 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
172 STT_OPTION_SILENCE_DETECTION_FALSE = 0, /**< Silence detection type - False */
173 STT_OPTION_SILENCE_DETECTION_TRUE = 1, /**< Silence detection type - True */
174 STT_OPTION_SILENCE_DETECTION_AUTO = 2 /**< Silence detection type - Auto */
175 } stt_option_silence_detection_e;
178 * @brief A structure of STT handler.
179 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
181 typedef struct stt_s *stt_h;
184 * @brief Called to get the engine information.
185 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
187 * @param[in] engine_id Engine id
188 * @param[in] engine_name Engine name
189 * @param[in] user_data User data passed from the stt_setting_foreach_supported_engines()
191 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
192 * @pre stt_foreach_supported_engines() will invoke this callback.
194 * @see stt_foreach_supported_engines()
196 typedef bool(*stt_supported_engine_cb)(stt_h stt, const char* engine_id, const char* engine_name, void* user_data);
199 * @brief Called when STT gets the recognition result from the engine.
200 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
202 * @remarks After stt_stop() is called, silence is detected from recording, or partial result is occured,
203 * this function is called.
205 * @param[in] stt The STT handle
206 * @param[in] event The result event
207 * @param[in] data Result texts
208 * @param[in] data_count Result text count
209 * @param[in] msg Engine message (e.g. #STT_RESULT_MESSAGE_NONE, #STT_RESULT_MESSAGE_ERROR_TOO_SHORT)
210 * @param[in] user_data The user data passed from the callback registration function
212 * @pre stt_stop() will invoke this callback if you register it using stt_set_result_cb().
213 * @post If this function is called and event is #STT_RESULT_EVENT_FINAL_RESULT, the STT state will be #STT_STATE_READY.
216 * @see stt_set_recognition_result_cb()
217 * @see stt_unset_recognition_result_cb()
219 typedef void (*stt_recognition_result_cb)(stt_h stt, stt_result_event_e event, const char** data, int data_count,
220 const char* msg, void *user_data);
223 * @brief Called when STT get the result time stamp in free partial type.
224 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
226 * @param[in] stt The STT handle
227 * @param[in] index The result index
228 * @param[in] event The token event
229 * @param[in] text The result text
230 * @param[in] start_time The start time of result text
231 * @param[in] end_time The end time of result text
232 * @param[in] user_data The user data passed from the foreach function
234 * @return @c true to continue with the next iteration of the loop \n @c false to break out of the loop
236 * @pre stt_recognition_result_cb() should be called.
238 * @see stt_recognition_result_cb()
240 typedef bool (*stt_result_time_cb)(stt_h stt, int index, stt_result_time_event_e event, const char* text,
241 long start_time, long end_time, void* user_data);
244 * @brief Called when the state of STT is changed.
245 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
247 * @param[in] stt The STT handle
248 * @param[in] previous A previous state
249 * @param[in] current A current state
250 * @param[in] user_data The user data passed from the callback registration function
252 * @pre An application registers this callback using stt_set_state_changed_cb() to detect changing state.
254 * @see stt_set_state_changed_cb()
255 * @see stt_unset_state_changed_cb()
257 typedef void (*stt_state_changed_cb)(stt_h stt, stt_state_e previous, stt_state_e current, void* user_data);
260 * @brief Called when an error occurs.
261 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
263 * @param[in] stt The STT handle
264 * @param[in] reason The error type (e.g. #STT_ERROR_OUT_OF_NETWORK, #STT_ERROR_IO_ERROR)
265 * @param[in] user_data The user data passed from the callback registration function
267 * @pre An application registers this callback using stt_set_error_cb() to detect error.
269 * @see stt_set_error_cb()
270 * @see stt_unset_error_cb()
272 typedef void (*stt_error_cb)(stt_h stt, stt_error_e reason, void *user_data);
275 * @brief Called to retrieve the supported languages.
276 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
277 * @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.
279 * @param[in] stt The STT handle
280 * @param[in] language The language
281 * @param[in] user_data The user data passed from the foreach function
283 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
284 * @pre stt_foreach_supported_languages() will invoke this callback.
286 * @see stt_foreach_supported_languages()
288 typedef bool (*stt_supported_language_cb)(stt_h stt, const char* language, void* user_data);
291 * @brief Called when the default language is changed.
292 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
294 * @param[in] stt The STT handle
295 * @param[in] previous_language A previous language
296 * @param[in] current_language A current language
297 * @param[in] user_data The user data passed from the callback registration function
299 * @see stt_set_default_language_changed_cb()
301 typedef void (*stt_default_language_changed_cb)(stt_h stt, const char* previous_language,
302 const char* current_language, void* user_data);
305 * @brief Called when the engine is changed.
306 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
308 * @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.
310 * @param[in] stt The STT handle
311 * @param[in] engine_id Engine id
312 * @param[in] language The default language
313 * @param[in] support_silence Whether the silence detection is supported or not
314 * @param[in] need_credential The necessity of credential
315 * @param[in] user_data The user data passed from the callback registration function
317 * @see stt_set_engine_changed_cb()
319 typedef void (*stt_engine_changed_cb)(stt_h stt, const char* engine_id, const char* language,
320 bool support_silence, bool need_credential, void* user_data);
323 * @brief Creates a STT handle.
324 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
326 * @privilege %http://tizen.org/privilege/recorder
328 * @remarks If the function succeeds, @a stt handle must be released with stt_destroy().
330 * @param[out] stt The STT handle
332 * @return 0 on success, otherwise a negative error value
333 * @retval #STT_ERROR_NONE Successful
334 * @retval #STT_ERROR_OUT_OF_MEMORY Out of memory
335 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
336 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
337 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
338 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
340 * @post If this function is called, the STT state will be #STT_STATE_CREATED.
344 int stt_create(stt_h* stt);
347 * @brief Destroys a STT handle.
348 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
350 * @privilege %http://tizen.org/privilege/recorder
352 * @param[in] stt The STT handle
354 * @return 0 on success, otherwise a negative error value
355 * @retval #STT_ERROR_NONE Successful
356 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
357 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
358 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
359 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
363 int stt_destroy(stt_h stt);
366 * @brief Retrieves supported engine information using a callback function.
367 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
369 * @privilege %http://tizen.org/privilege/recorder
371 * @param[in] stt The STT handle
372 * @param[in] callback The callback function to invoke
373 * @param[in] user_data The user data to be passed to the callback function
375 * @return 0 on success, otherwise a negative error value
376 * @retval #STT_ERROR_NONE Success
377 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
378 * @retval #STT_ERROR_INVALID_STATE STT Not initialized
379 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
380 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
381 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
383 * @pre The state should be #STT_STATE_CREATED.
384 * @post This function invokes stt_supported_engine_cb() repeatedly for getting engine information.
386 * @see stt_supported_engine_cb()
388 int stt_foreach_supported_engines(stt_h stt, stt_supported_engine_cb callback, void* user_data);
391 * @brief Gets the current engine id.
392 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
394 * @privilege %http://tizen.org/privilege/recorder
396 * @remarks If the function is success, @a engine_id must be released using free().
398 * @param[in] stt The STT handle
399 * @param[out] engine_id Engine id
401 * @return 0 on success, otherwise a negative error value
402 * @retval #STT_ERROR_NONE Success
403 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
404 * @retval #STT_ERROR_INVALID_STATE STT Not initialized
405 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
406 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
407 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
409 * @pre The state should be #STT_STATE_CREATED.
411 * @see stt_set_engine()
413 int stt_get_engine(stt_h stt, char** engine_id);
416 * @brief Sets the engine id.
417 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
419 * @privilege %http://tizen.org/privilege/recorder
420 * @privilege %http://tizen.org/privilege/appmanager.launch
422 * @param[in] stt The STT handle
423 * @param[in] engine_id Engine id
425 * @return 0 on success, otherwise a negative error value
426 * @retval #STT_ERROR_NONE Success
427 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
428 * @retval #STT_ERROR_INVALID_STATE STT Not initialized
429 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
430 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
431 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
433 * @pre The state should be #STT_STATE_CREATED.
435 * @see stt_get_engine()
437 int stt_set_engine(stt_h stt, const char* engine_id);
440 * @brief Sets the app credential.
441 * @details Using this API, the application can set a credential.
442 * The credential is a key to verify the authorization about using the engine.
443 * If the application sets the credential, it will be able to use functions of the engine entirely.
444 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
446 * @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.
447 * 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.
449 * @param[in] stt The STT handle
450 * @param[in] credential The app credential
452 * @return 0 on success, otherwise a negative error value
453 * @retval #STT_ERROR_NONE Success
454 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
455 * @retval #STT_ERROR_INVALID_STATE Invalid state
456 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
458 * @pre The state should be #STT_STATE_CREATED or #STT_STATE_READY.
463 int stt_set_credential(stt_h stt, const char* credential);
466 * @brief Sets the private data to stt engine.
467 * @details The private data is the setting parameter for applying keys provided by the engine.
468 * Using this API, the application can set the private data and use the corresponding key of the engine.
469 * For example, if the engine provides 'partial recognition' as a recognition type, the application can set the private data as the following. \n
470 * int ret = stt_set_private_data(stt_h, "recognition_type", "PARTIAL");
472 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
474 * @remarks If the engine is replaced with the other engine, the key may be ignored.
476 * @param[in] stt The STT handle
477 * @param[in] key The field name of private data
478 * @param[in] data The data for set
480 * @return 0 on success, otherwise a negative error value
481 * @retval #STT_ERROR_NONE Successful
482 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
483 * @retval #STT_ERROR_INVALID_STATE Invalid state
484 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
485 * @retval #STT_ERROR_TIMED_OUT No answer from the STT service
487 * @pre The state should be #STT_STATE_READY.
489 * @see stt_get_private_data()
491 int stt_set_private_data(stt_h stt, const char* key, const char* data);
494 * @brief Gets the private data from stt engine.
495 * @details The private data is the information provided by the engine.
496 * Using this API, the application can get the private data which corresponds to the key from the engine.
498 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
500 * @remarks If the engine is replaced with the other engine, the key may be ignored.
502 * @param[in] stt The STT handle
503 * @param[in] key The field name of private data
504 * @param[out] data The data field of private data
506 * @remarks The @a data must be released using free() when it is no longer required.
508 * @return 0 on success, otherwise a negative error value
509 * @retval #STT_ERROR_NONE Successful
510 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
511 * @retval #STT_ERROR_INVALID_STATE Invalid state
512 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
513 * @retval #STT_ERROR_TIMED_OUT No answer from the STT service
515 * @pre The state should be #STT_STATE_READY.
517 * @see stt_set_private_data()
519 int stt_get_private_data(stt_h stt, const char* key, char** data);
522 * @brief Connects the STT service asynchronously.
523 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
525 * @privilege %http://tizen.org/privilege/recorder
527 * @param[in] stt The STT handle
529 * @return 0 on success, otherwise a negative error value
530 * @retval #STT_ERROR_NONE Successful
531 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
532 * @retval #STT_ERROR_INVALID_STATE Invalid state
533 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
534 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
536 * @pre The state should be #STT_STATE_CREATED.
537 * @post If this function is successful, the STT state will be #STT_STATE_READY. \n
538 * If this function is failed, the error callback is called. (e.g. #STT_ERROR_ENGINE_NOT_FOUND)
540 * @see stt_unprepare()
542 int stt_prepare(stt_h stt);
545 * @brief Disconnects the STT service.
546 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
548 * @privilege %http://tizen.org/privilege/recorder
550 * @param[in] stt The STT handle
552 * @return 0 on success, otherwise a negative error value
553 * @retval #STT_ERROR_NONE Successful
554 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
555 * @retval #STT_ERROR_INVALID_STATE Invalid state
556 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
557 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
559 * @pre The state should be #STT_STATE_READY.
560 * @post If this function is called, the STT state will be #STT_STATE_CREATED.
564 int stt_unprepare(stt_h stt);
567 * @brief Retrieves all supported languages of current engine using callback function.
568 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
570 * @privilege %http://tizen.org/privilege/recorder
572 * @param[in] stt The STT handle
573 * @param[in] callback The callback function to invoke
574 * @param[in] user_data The user data to be passed to the callback function
576 * @return 0 on success, otherwise a negative error value
577 * @retval #STT_ERROR_NONE Successful
578 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
579 * @retval #STT_ERROR_OUT_OF_MEMORY Out of memory
580 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
581 * @retval #STT_ERROR_ENGINE_NOT_FOUND No available engine
582 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
583 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
585 * @post This function invokes stt_supported_language_cb() repeatedly for getting languages.
587 * @see stt_supported_language_cb()
588 * @see stt_get_default_language()
590 int stt_foreach_supported_languages(stt_h stt, stt_supported_language_cb callback, void* user_data);
593 * @brief Gets the default language set by the user.
594 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
596 * @privilege %http://tizen.org/privilege/recorder
597 * @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. \n
598 * For example, "ko_KR" for Korean, "en_US" for American English. \n
599 * If the function succeeds, @a language must be released using free() when it is no longer required.
601 * @param[in] stt The STT handle
602 * @param[out] language The language
604 * @return 0 on success, otherwise a negative error value
605 * @retval #STT_ERROR_NONE Successful
606 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
607 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
608 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
609 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
611 * @see stt_foreach_supported_languages()
613 int stt_get_default_language(stt_h stt, char** language);
616 * @brief Gets the current STT state.
617 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
619 * @privilege %http://tizen.org/privilege/recorder
621 * @param[in] stt The STT handle
622 * @param[out] state The current STT state
624 * @return 0 on success, otherwise a negative error value
625 * @retval #STT_ERROR_NONE Successful
626 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
627 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
628 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
633 * @see stt_state_changed_cb()
635 int stt_get_state(stt_h stt, stt_state_e* state);
638 * @brief Gets the current error message.
639 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
640 * @remarks This function should be called during an stt error callback. If not, the error as operation failure will be returned. \n
641 * If the function succeeds, @a err_msg must be released using free() when it is no longer required.
643 * @param[in] stt The STT handle
644 * @param[out] err_msg The current error message
646 * @return 0 on success, otherwise a negative error value
647 * @retval #STT_ERROR_NONE Successful
648 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
649 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
650 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
652 * @see stt_set_error_cb()
653 * @see stt_unset_error_cb()
655 int stt_get_error_message(stt_h stt, char** err_msg);
658 * @brief Checks whether the recognition type is supported.
659 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
661 * @privilege %http://tizen.org/privilege/recorder
663 * @param[in] stt The STT handle
664 * @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
665 * @param[out] support The result status @c true = supported, @c false = not supported
667 * @return 0 on success, otherwise a negative error value
668 * @retval #STT_ERROR_NONE Successful
669 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
670 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
671 * @retval #STT_ERROR_INVALID_STATE Invalid state
672 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
673 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
675 * @pre The state should be #STT_STATE_READY.
677 int stt_is_recognition_type_supported(stt_h stt, const char* type, bool* support);
680 * @brief Sets the silence detection.
681 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
683 * @privilege %http://tizen.org/privilege/recorder
685 * @param[in] stt The STT handle
686 * @param[in] type The option type
688 * @return 0 on success, otherwise a negative error value
689 * @retval #STT_ERROR_NONE Successful
690 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
691 * @retval #STT_ERROR_INVALID_STATE Invalid state
692 * @retval #STT_ERROR_NOT_SUPPORTED_FEATURE Not supported feature of current engine
693 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
694 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
696 * @pre The state should be #STT_STATE_READY.
698 int stt_set_silence_detection(stt_h stt, stt_option_silence_detection_e type);
701 * @brief Sets the sound to start recording.
702 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
704 * @privilege %http://tizen.org/privilege/recorder
706 * @remarks Sound file type should be wav type.
708 * @param[in] stt The STT handle
709 * @param[in] filename The sound file path
711 * @return 0 on success, otherwise a negative error value
712 * @retval #STT_ERROR_NONE Successful
713 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
714 * @retval #STT_ERROR_INVALID_STATE Invalid state
715 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
716 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
717 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
719 * @pre The state should be #STT_STATE_READY.
721 int stt_set_start_sound(stt_h stt, const char* filename);
724 * @brief Unsets the sound to start recording.
725 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
727 * @privilege %http://tizen.org/privilege/recorder
729 * @param[in] stt The STT handle
731 * @return 0 on success, otherwise a negative error value
732 * @retval #STT_ERROR_NONE Successful
733 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
734 * @retval #STT_ERROR_INVALID_STATE Invalid state
735 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
736 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
737 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
739 * @pre The state should be #STT_STATE_READY.
741 int stt_unset_start_sound(stt_h stt);
744 * @brief Sets the sound to stop recording.
745 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
747 * @privilege %http://tizen.org/privilege/recorder
749 * @remarks Sound file type should be wav type.
751 * @param[in] stt The STT handle
752 * @param[in] filename The sound file path
754 * @return 0 on success, otherwise a negative error value
755 * @retval #STT_ERROR_NONE Successful
756 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
757 * @retval #STT_ERROR_INVALID_STATE Invalid state
758 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
759 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
760 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
762 * @pre The state should be #STT_STATE_READY.
764 int stt_set_stop_sound(stt_h stt, const char* filename);
767 * @brief Unsets the sound to stop recording.
768 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
770 * @privilege %http://tizen.org/privilege/recorder
772 * @param[in] stt The STT handle
774 * @return 0 on success, otherwise a negative error value
775 * @retval #STT_ERROR_NONE Successful
776 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
777 * @retval #STT_ERROR_INVALID_STATE Invalid state
778 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
779 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
780 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
782 * @pre The state should be #STT_STATE_READY.
784 int stt_unset_stop_sound(stt_h stt);
787 * @brief Starts recording and recognition asynchronously.
788 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
790 * @privilege %http://tizen.org/privilege/recorder
792 * @remarks This function starts recording in the STT service and sending recording data to engine. \n
793 * This work continues until stt_stop(), stt_cancel() or silence detected by engine.
795 * @param[in] stt The STT handle
796 * @param[in] language The language selected from stt_foreach_supported_languages()
797 * @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
799 * @return 0 on success, otherwise a negative error value
800 * @retval #STT_ERROR_NONE Successful
801 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
802 * @retval #STT_ERROR_INVALID_STATE Invalid state
803 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
804 * @retval #STT_ERROR_RECORDER_BUSY Recorder busy
805 * @retval #STT_ERROR_INVALID_LANGUAGE Invalid language
806 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
807 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
808 * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
810 * @pre The state should be #STT_STATE_READY.
811 * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
812 * If this function succeeds, the STT state will be #STT_STATE_RECORDING.
813 * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_RECORDING.
817 * @see stt_state_changed_cb()
819 int stt_start(stt_h stt, const char* language, const char* type);
822 * @brief Finishes the recording and starts recognition processing in engine asynchronously.
823 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
825 * @privilege %http://tizen.org/privilege/recorder
827 * @param[in] stt The STT handle
829 * @return 0 on success, otherwise a negative error value
830 * @retval #STT_ERROR_NONE Successful
831 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
832 * @retval #STT_ERROR_INVALID_STATE Invalid state
833 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
834 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
835 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
836 * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
837 * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
838 * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
840 * @pre The state should be #STT_STATE_RECORDING.
841 * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
842 * If this function succeeds, the STT state will be #STT_STATE_PROCESSING. \n
843 * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_PROCESSING.
844 * After processing of engine, stt_result_cb() is called.
848 * @see stt_state_changed_cb()
850 int stt_stop(stt_h stt);
853 * @brief Cancels processing recognition and recording asynchronously.
854 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
856 * @privilege %http://tizen.org/privilege/recorder
858 * @remarks This function cancels recording and engine cancels recognition processing. \n
859 * After successful cancel, stt_state_changed_cb() is called otherwise if error is occurred, stt_error_cb() is called.
861 * @param[in] stt The STT handle
863 * @return 0 on success, otherwise a negative error value
864 * @retval #STT_ERROR_NONE Successful
865 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
866 * @retval #STT_ERROR_INVALID_STATE Invalid state
867 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
868 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
869 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
870 * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
871 * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
872 * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
874 * @pre The state should be #STT_STATE_RECORDING or #STT_STATE_PROCESSING.
875 * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
876 * If this function succeeds, the STT state will be #STT_STATE_READY.
877 * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_READY.
881 * @see stt_state_changed_cb()
883 int stt_cancel(stt_h stt);
886 * @brief Gets the microphone volume during recording.
887 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
889 * @privilege %http://tizen.org/privilege/recorder
891 * @param[in] stt The STT handle
892 * @param[out] volume Recording volume
894 * @return 0 on success, otherwise a negative error value
895 * @retval #STT_ERROR_NONE Successful
896 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
897 * @retval #STT_ERROR_INVALID_STATE Invalid state
898 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
899 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
900 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
902 * @pre The state should be #STT_STATE_RECORDING.
906 int stt_get_recording_volume(stt_h stt, float* volume);
909 * @brief Retrieves the time stamp of the current recognition result using the callback function.
910 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
912 * @privilege %http://tizen.org/privilege/recorder
914 * @remarks This function should be called in stt_recognition_result_cb().
915 * After stt_recognition_result_cb(), result data is NOT valid.
917 * @param[in] stt The STT handle
918 * @param[in] callback The callback function to invoke
919 * @param[in] user_data The user data to be passed to the callback function
921 * @return 0 on success, otherwise a negative error value
922 * @retval #STT_ERROR_NONE Successful
923 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
924 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
925 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
926 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
928 * @pre This function should be called in stt_recognition_result_cb().
929 * @post This function invokes stt_result_time_cb() repeatedly for getting time information.
931 * @see stt_result_time_cb()
932 * @see stt_recognition_result_cb()
934 int stt_foreach_detailed_result(stt_h stt, stt_result_time_cb callback, void* user_data);
937 * @brief Registers a callback function to get the recognition result.
938 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
940 * @privilege %http://tizen.org/privilege/recorder
942 * @param[in] stt The STT handle
943 * @param[in] callback The callback function to register
944 * @param[in] user_data The user data to be passed to the callback function
946 * @return 0 on success, otherwise a negative error value
947 * @retval #STT_ERROR_NONE Successful
948 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
949 * @retval #STT_ERROR_INVALID_STATE Invalid state
950 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
951 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
953 * @pre The state should be #STT_STATE_CREATED.
955 * @see stt_recognition_result_cb()
956 * @see stt_unset_recognition_result_cb()
958 int stt_set_recognition_result_cb(stt_h stt, stt_recognition_result_cb callback, void* user_data);
961 * @brief Unregisters the callback function.
962 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
964 * @privilege %http://tizen.org/privilege/recorder
966 * @param[in] stt The STT handle
968 * @return 0 on success, otherwise a negative error value
969 * @retval #STT_ERROR_NONE Successful
970 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
971 * @retval #STT_ERROR_INVALID_STATE Invalid state
972 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
973 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
975 * @pre The state should be #STT_STATE_CREATED.
977 * @see stt_set_recognition_result_cb()
979 int stt_unset_recognition_result_cb(stt_h stt);
982 * @brief Registers a callback function to be called when STT state changes.
983 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
985 * @privilege %http://tizen.org/privilege/recorder
987 * @param[in] stt The STT handle
988 * @param[in] callback The callback function to register
989 * @param[in] user_data The user data to be passed to the callback function
991 * @return 0 on success, otherwise a negative error value
992 * @retval #STT_ERROR_NONE Successful
993 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
994 * @retval #STT_ERROR_INVALID_STATE Invalid state
995 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
996 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
998 * @pre The state should be #STT_STATE_CREATED.
1000 * @see stt_state_changed_cb()
1001 * @see stt_unset_state_changed_cb()
1003 int stt_set_state_changed_cb(stt_h stt, stt_state_changed_cb callback, void* user_data);
1006 * @brief Unregisters the callback function.
1007 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1009 * @privilege %http://tizen.org/privilege/recorder
1011 * @param[in] stt The STT handle
1013 * @return 0 on success, otherwise a negative error value
1014 * @retval #STT_ERROR_NONE Successful
1015 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1016 * @retval #STT_ERROR_INVALID_STATE Invalid state
1017 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1018 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1020 * @pre The state should be #STT_STATE_CREATED.
1022 * @see stt_set_state_changed_cb()
1024 int stt_unset_state_changed_cb(stt_h stt);
1027 * @brief Registers a callback function to be called when an error occurred.
1028 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1030 * @privilege %http://tizen.org/privilege/recorder
1032 * @param[in] stt The STT handle
1033 * @param[in] callback The callback function to register
1034 * @param[in] user_data The user data to be passed to the callback function
1036 * @return 0 on success, otherwise a negative error value
1037 * @retval #STT_ERROR_NONE Successful
1038 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1039 * @retval #STT_ERROR_INVALID_STATE Invalid state
1040 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1041 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1043 * @pre The state should be #STT_STATE_CREATED.
1045 * @see stt_error_cb()
1046 * @see stt_unset_error_cb()
1048 int stt_set_error_cb(stt_h stt, stt_error_cb callback, void* user_data);
1051 * @brief Unregisters the callback function.
1052 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1054 * @privilege %http://tizen.org/privilege/recorder
1056 * @param[in] stt The STT handle
1058 * @return 0 on success, otherwise a negative error value
1059 * @retval #STT_ERROR_NONE Successful
1060 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1061 * @retval #STT_ERROR_INVALID_STATE Invalid state
1062 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1063 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1065 * @pre The state should be #STT_STATE_CREATED.
1067 * @see stt_set_error_cb()
1069 int stt_unset_error_cb(stt_h stt);
1072 * @brief Registers a callback function to detect the default language change.
1073 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1075 * @privilege %http://tizen.org/privilege/recorder
1077 * @param[in] stt The STT handle
1078 * @param[in] callback The callback function to register
1079 * @param[in] user_data The user data to be passed to the callback function
1081 * @return 0 on success, otherwise a negative error value
1082 * @retval #STT_ERROR_NONE Successful
1083 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1084 * @retval #STT_ERROR_INVALID_STATE Invalid state
1085 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1086 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1088 * @pre The state should be #STT_STATE_CREATED.
1090 * @see stt_default_language_changed_cb()
1091 * @see stt_unset_default_language_changed_cb()
1093 int stt_set_default_language_changed_cb(stt_h stt, stt_default_language_changed_cb callback, void* user_data);
1096 * @brief Unregisters the callback function.
1097 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1099 * @privilege %http://tizen.org/privilege/recorder
1101 * @param[in] stt The STT handle
1103 * @return 0 on success, otherwise a negative error value
1104 * @retval #STT_ERROR_NONE Successful
1105 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1106 * @retval #STT_ERROR_INVALID_STATE Invalid state
1107 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1108 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1110 * @pre The state should be #STT_STATE_CREATED.
1112 * @see stt_set_default_language_changed_cb()
1114 int stt_unset_default_language_changed_cb(stt_h stt);
1117 * @brief Registers a callback function to detect the engine change.
1118 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
1120 * @param[in] stt The STT handle
1121 * @param[in] callback The callback function to register
1122 * @param[in] user_data The user data to be passed to the callback function
1124 * @return 0 on success, otherwise a negative error value
1125 * @retval #STT_ERROR_NONE Successful
1126 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1127 * @retval #STT_ERROR_INVALID_STATE Invalid state
1128 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1130 * @pre The state should be #STT_STATE_CREATED.
1132 * @see stt_engine_changed_cb()
1133 * @see stt_unset_engine_changed_cb()
1135 int stt_set_engine_changed_cb(stt_h stt, stt_engine_changed_cb callback, void* user_data);
1138 * @brief Unregisters the callback function.
1139 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
1141 * @param[in] stt The STT handle
1143 * @return 0 on success, otherwise a negative error value
1144 * @retval #STT_ERROR_NONE Successful
1145 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1146 * @retval #STT_ERROR_INVALID_STATE Invalid state
1147 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1149 * @pre The state should be #STT_STATE_CREATED.
1151 * @see stt_set_engine_changed_cb()
1153 int stt_unset_engine_changed_cb(stt_h stt);
1164 #endif /* __STT_H__ */