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
421 * @param[in] stt The STT handle
422 * @param[in] engine_id Engine id
424 * @return 0 on success, otherwise a negative error value
425 * @retval #STT_ERROR_NONE Success
426 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
427 * @retval #STT_ERROR_INVALID_STATE STT Not initialized
428 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
429 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
430 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
432 * @pre The state should be #STT_STATE_CREATED.
434 * @see stt_get_engine()
436 int stt_set_engine(stt_h stt, const char* engine_id);
439 * @brief Sets the app credential.
440 * @details Using this API, the application can set a credential.
441 * The credential is a key to verify the authorization about using the engine.
442 * If the application sets the credential, it will be able to use functions of the engine entirely.
443 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
445 * @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.
446 * 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.
448 * @param[in] stt The STT handle
449 * @param[in] credential The app credential
451 * @return 0 on success, otherwise a negative error value
452 * @retval #STT_ERROR_NONE Success
453 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
454 * @retval #STT_ERROR_INVALID_STATE Invalid state
455 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
457 * @pre The state should be #STT_STATE_CREATED or #STT_STATE_READY.
462 int stt_set_credential(stt_h stt, const char* credential);
465 * @brief Sets the private data to stt engine.
466 * @details The private data is the setting parameter for applying keys provided by the engine.
467 * Using this API, the application can set the private data and use the corresponding key of the engine.
468 * For example, if the engine provides 'partial recognition' as a recognition type, the application can set the private data as the following. \n
469 * int ret = stt_set_private_data(stt_h, "recognition_type", "PARTIAL");
471 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
473 * @remarks If the engine is replaced with the other engine, the key may be ignored.
475 * @param[in] stt The STT handle
476 * @param[in] key The field name of private data
477 * @param[in] data The data for set
479 * @return 0 on success, otherwise a negative error value
480 * @retval #STT_ERROR_NONE Successful
481 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
482 * @retval #STT_ERROR_INVALID_STATE Invalid state
483 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
484 * @retval #STT_ERROR_TIMED_OUT No answer from the STT service
486 * @pre The state should be #STT_STATE_READY.
488 * @see stt_get_private_data()
490 int stt_set_private_data(stt_h stt, const char* key, const char* data);
493 * @brief Gets the private data from stt engine.
494 * @details The private data is the information provided by the engine.
495 * Using this API, the application can get the private data which corresponds to the key from the engine.
497 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
499 * @remarks If the engine is replaced with the other engine, the key may be ignored.
501 * @param[in] stt The STT handle
502 * @param[in] key The field name of private data
503 * @param[out] data The data field of private data
505 * @remarks The @a data must be released using free() when it is no longer required.
507 * @return 0 on success, otherwise a negative error value
508 * @retval #STT_ERROR_NONE Successful
509 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
510 * @retval #STT_ERROR_INVALID_STATE Invalid state
511 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
512 * @retval #STT_ERROR_TIMED_OUT No answer from the STT service
514 * @pre The state should be #STT_STATE_READY.
516 * @see stt_set_private_data()
518 int stt_get_private_data(stt_h stt, const char* key, char** data);
521 * @brief Connects the STT service asynchronously.
522 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
524 * @privilege %http://tizen.org/privilege/recorder
526 * @param[in] stt The STT handle
528 * @return 0 on success, otherwise a negative error value
529 * @retval #STT_ERROR_NONE Successful
530 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
531 * @retval #STT_ERROR_INVALID_STATE Invalid state
532 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
533 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
535 * @pre The state should be #STT_STATE_CREATED.
536 * @post If this function is successful, the STT state will be #STT_STATE_READY. \n
537 * If this function is failed, the error callback is called. (e.g. #STT_ERROR_ENGINE_NOT_FOUND)
539 * @see stt_unprepare()
541 int stt_prepare(stt_h stt);
544 * @brief Disconnects the STT service.
545 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
547 * @privilege %http://tizen.org/privilege/recorder
549 * @param[in] stt The STT handle
551 * @return 0 on success, otherwise a negative error value
552 * @retval #STT_ERROR_NONE Successful
553 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
554 * @retval #STT_ERROR_INVALID_STATE Invalid state
555 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
556 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
558 * @pre The state should be #STT_STATE_READY.
559 * @post If this function is called, the STT state will be #STT_STATE_CREATED.
563 int stt_unprepare(stt_h stt);
566 * @brief Retrieves all supported languages of current engine using callback function.
567 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
569 * @privilege %http://tizen.org/privilege/recorder
571 * @param[in] stt The STT handle
572 * @param[in] callback The callback function to invoke
573 * @param[in] user_data The user data to be passed to the callback function
575 * @return 0 on success, otherwise a negative error value
576 * @retval #STT_ERROR_NONE Successful
577 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
578 * @retval #STT_ERROR_OUT_OF_MEMORY Out of memory
579 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
580 * @retval #STT_ERROR_ENGINE_NOT_FOUND No available engine
581 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
582 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
584 * @post This function invokes stt_supported_language_cb() repeatedly for getting languages.
586 * @see stt_supported_language_cb()
587 * @see stt_get_default_language()
589 int stt_foreach_supported_languages(stt_h stt, stt_supported_language_cb callback, void* user_data);
592 * @brief Gets the default language set by the user.
593 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
595 * @privilege %http://tizen.org/privilege/recorder
596 * @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
597 * For example, "ko_KR" for Korean, "en_US" for American English. \n
598 * If the function succeeds, @a language must be released using free() when it is no longer required.
600 * @param[in] stt The STT handle
601 * @param[out] language The language
603 * @return 0 on success, otherwise a negative error value
604 * @retval #STT_ERROR_NONE Successful
605 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
606 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
607 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
608 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
610 * @see stt_foreach_supported_languages()
612 int stt_get_default_language(stt_h stt, char** language);
615 * @brief Gets the current STT state.
616 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
618 * @privilege %http://tizen.org/privilege/recorder
620 * @param[in] stt The STT handle
621 * @param[out] state The current STT state
623 * @return 0 on success, otherwise a negative error value
624 * @retval #STT_ERROR_NONE Successful
625 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
626 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
627 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
632 * @see stt_state_changed_cb()
634 int stt_get_state(stt_h stt, stt_state_e* state);
637 * @brief Gets the current error message.
638 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
639 * @remarks This function should be called during an stt error callback. If not, the error as operation failure will be returned. \n
640 * If the function succeeds, @a err_msg must be released using free() when it is no longer required.
642 * @param[in] stt The STT handle
643 * @param[out] err_msg The current error message
645 * @return 0 on success, otherwise a negative error value
646 * @retval #STT_ERROR_NONE Successful
647 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
648 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
649 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
651 * @see stt_set_error_cb()
652 * @see stt_unset_error_cb()
654 int stt_get_error_message(stt_h stt, char** err_msg);
657 * @brief Checks whether the recognition type is supported.
658 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
660 * @privilege %http://tizen.org/privilege/recorder
662 * @param[in] stt The STT handle
663 * @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
664 * @param[out] support The result status @c true = supported, @c false = not supported
666 * @return 0 on success, otherwise a negative error value
667 * @retval #STT_ERROR_NONE Successful
668 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
669 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
670 * @retval #STT_ERROR_INVALID_STATE Invalid state
671 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
672 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
674 * @pre The state should be #STT_STATE_READY.
676 int stt_is_recognition_type_supported(stt_h stt, const char* type, bool* support);
679 * @brief Sets the silence detection.
680 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
682 * @privilege %http://tizen.org/privilege/recorder
684 * @param[in] stt The STT handle
685 * @param[in] type The option type
687 * @return 0 on success, otherwise a negative error value
688 * @retval #STT_ERROR_NONE Successful
689 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
690 * @retval #STT_ERROR_INVALID_STATE Invalid state
691 * @retval #STT_ERROR_NOT_SUPPORTED_FEATURE Not supported feature of current engine
692 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
693 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
695 * @pre The state should be #STT_STATE_READY.
697 int stt_set_silence_detection(stt_h stt, stt_option_silence_detection_e type);
700 * @brief Sets the sound to start recording.
701 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
703 * @privilege %http://tizen.org/privilege/recorder
705 * @remarks Sound file type should be wav type.
707 * @param[in] stt The STT handle
708 * @param[in] filename The sound file path
710 * @return 0 on success, otherwise a negative error value
711 * @retval #STT_ERROR_NONE Successful
712 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
713 * @retval #STT_ERROR_INVALID_STATE Invalid state
714 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
715 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
716 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
718 * @pre The state should be #STT_STATE_READY.
720 int stt_set_start_sound(stt_h stt, const char* filename);
723 * @brief Unsets the sound to start recording.
724 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
726 * @privilege %http://tizen.org/privilege/recorder
728 * @param[in] stt The STT handle
730 * @return 0 on success, otherwise a negative error value
731 * @retval #STT_ERROR_NONE Successful
732 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
733 * @retval #STT_ERROR_INVALID_STATE Invalid state
734 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
735 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
736 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
738 * @pre The state should be #STT_STATE_READY.
740 int stt_unset_start_sound(stt_h stt);
743 * @brief Sets the sound to stop recording.
744 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
746 * @privilege %http://tizen.org/privilege/recorder
748 * @remarks Sound file type should be wav type.
750 * @param[in] stt The STT handle
751 * @param[in] filename The sound file path
753 * @return 0 on success, otherwise a negative error value
754 * @retval #STT_ERROR_NONE Successful
755 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
756 * @retval #STT_ERROR_INVALID_STATE Invalid state
757 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
758 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
759 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
761 * @pre The state should be #STT_STATE_READY.
763 int stt_set_stop_sound(stt_h stt, const char* filename);
766 * @brief Unsets the sound to stop recording.
767 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
769 * @privilege %http://tizen.org/privilege/recorder
771 * @param[in] stt The STT handle
773 * @return 0 on success, otherwise a negative error value
774 * @retval #STT_ERROR_NONE Successful
775 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
776 * @retval #STT_ERROR_INVALID_STATE Invalid state
777 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
778 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
779 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
781 * @pre The state should be #STT_STATE_READY.
783 int stt_unset_stop_sound(stt_h stt);
786 * @brief Starts recording and recognition asynchronously.
787 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
789 * @privilege %http://tizen.org/privilege/recorder
791 * @remarks This function starts recording in the STT service and sending recording data to engine. \n
792 * This work continues until stt_stop(), stt_cancel() or silence detected by engine.
794 * @param[in] stt The STT handle
795 * @param[in] language The language selected from stt_foreach_supported_languages()
796 * @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
798 * @return 0 on success, otherwise a negative error value
799 * @retval #STT_ERROR_NONE Successful
800 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
801 * @retval #STT_ERROR_INVALID_STATE Invalid state
802 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
803 * @retval #STT_ERROR_RECORDER_BUSY Recorder busy
804 * @retval #STT_ERROR_INVALID_LANGUAGE Invalid language
805 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
806 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
807 * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
809 * @pre The state should be #STT_STATE_READY.
810 * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
811 * If this function succeeds, the STT state will be #STT_STATE_RECORDING.
812 * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_RECORDING.
816 * @see stt_state_changed_cb()
818 int stt_start(stt_h stt, const char* language, const char* type);
821 * @brief Finishes the recording and starts recognition processing in engine asynchronously.
822 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
824 * @privilege %http://tizen.org/privilege/recorder
826 * @param[in] stt The STT handle
828 * @return 0 on success, otherwise a negative error value
829 * @retval #STT_ERROR_NONE Successful
830 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
831 * @retval #STT_ERROR_INVALID_STATE Invalid state
832 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
833 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
834 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
835 * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
836 * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
837 * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
839 * @pre The state should be #STT_STATE_RECORDING.
840 * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
841 * If this function succeeds, the STT state will be #STT_STATE_PROCESSING. \n
842 * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_PROCESSING.
843 * After processing of engine, stt_result_cb() is called.
847 * @see stt_state_changed_cb()
849 int stt_stop(stt_h stt);
852 * @brief Cancels processing recognition and recording asynchronously.
853 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
855 * @privilege %http://tizen.org/privilege/recorder
857 * @remarks This function cancels recording and engine cancels recognition processing. \n
858 * After successful cancel, stt_state_changed_cb() is called otherwise if error is occurred, stt_error_cb() is called.
860 * @param[in] stt The STT handle
862 * @return 0 on success, otherwise a negative error value
863 * @retval #STT_ERROR_NONE Successful
864 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
865 * @retval #STT_ERROR_INVALID_STATE Invalid state
866 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
867 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
868 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
869 * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
870 * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
871 * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
873 * @pre The state should be #STT_STATE_RECORDING or #STT_STATE_PROCESSING.
874 * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
875 * If this function succeeds, the STT state will be #STT_STATE_READY.
876 * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_READY.
880 * @see stt_state_changed_cb()
882 int stt_cancel(stt_h stt);
885 * @brief Gets the microphone volume during recording.
886 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
888 * @privilege %http://tizen.org/privilege/recorder
890 * @param[in] stt The STT handle
891 * @param[out] volume Recording volume
893 * @return 0 on success, otherwise a negative error value
894 * @retval #STT_ERROR_NONE Successful
895 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
896 * @retval #STT_ERROR_INVALID_STATE Invalid state
897 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
898 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
899 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
901 * @pre The state should be #STT_STATE_RECORDING.
905 int stt_get_recording_volume(stt_h stt, float* volume);
908 * @brief Retrieves the time stamp of the current recognition result using the callback function.
909 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
911 * @privilege %http://tizen.org/privilege/recorder
913 * @remarks This function should be called in stt_recognition_result_cb().
914 * After stt_recognition_result_cb(), result data is NOT valid.
916 * @param[in] stt The STT handle
917 * @param[in] callback The callback function to invoke
918 * @param[in] user_data The user data to be passed to the callback function
920 * @return 0 on success, otherwise a negative error value
921 * @retval #STT_ERROR_NONE Successful
922 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
923 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
924 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
925 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
927 * @pre This function should be called in stt_recognition_result_cb().
928 * @post This function invokes stt_result_time_cb() repeatedly for getting time information.
930 * @see stt_result_time_cb()
931 * @see stt_recognition_result_cb()
933 int stt_foreach_detailed_result(stt_h stt, stt_result_time_cb callback, void* user_data);
936 * @brief Registers a callback function to get the recognition result.
937 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
939 * @privilege %http://tizen.org/privilege/recorder
941 * @param[in] stt The STT handle
942 * @param[in] callback The callback function to register
943 * @param[in] user_data The user data to be passed to the callback function
945 * @return 0 on success, otherwise a negative error value
946 * @retval #STT_ERROR_NONE Successful
947 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
948 * @retval #STT_ERROR_INVALID_STATE Invalid state
949 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
950 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
952 * @pre The state should be #STT_STATE_CREATED.
954 * @see stt_recognition_result_cb()
955 * @see stt_unset_recognition_result_cb()
957 int stt_set_recognition_result_cb(stt_h stt, stt_recognition_result_cb callback, void* user_data);
960 * @brief Unregisters the callback function.
961 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
963 * @privilege %http://tizen.org/privilege/recorder
965 * @param[in] stt The STT handle
967 * @return 0 on success, otherwise a negative error value
968 * @retval #STT_ERROR_NONE Successful
969 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
970 * @retval #STT_ERROR_INVALID_STATE Invalid state
971 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
972 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
974 * @pre The state should be #STT_STATE_CREATED.
976 * @see stt_set_recognition_result_cb()
978 int stt_unset_recognition_result_cb(stt_h stt);
981 * @brief Registers a callback function to be called when STT state changes.
982 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
984 * @privilege %http://tizen.org/privilege/recorder
986 * @param[in] stt The STT handle
987 * @param[in] callback The callback function to register
988 * @param[in] user_data The user data to be passed to the callback function
990 * @return 0 on success, otherwise a negative error value
991 * @retval #STT_ERROR_NONE Successful
992 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
993 * @retval #STT_ERROR_INVALID_STATE Invalid state
994 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
995 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
997 * @pre The state should be #STT_STATE_CREATED.
999 * @see stt_state_changed_cb()
1000 * @see stt_unset_state_changed_cb()
1002 int stt_set_state_changed_cb(stt_h stt, stt_state_changed_cb callback, void* user_data);
1005 * @brief Unregisters the callback function.
1006 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1008 * @privilege %http://tizen.org/privilege/recorder
1010 * @param[in] stt The STT handle
1012 * @return 0 on success, otherwise a negative error value
1013 * @retval #STT_ERROR_NONE Successful
1014 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1015 * @retval #STT_ERROR_INVALID_STATE Invalid state
1016 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1017 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1019 * @pre The state should be #STT_STATE_CREATED.
1021 * @see stt_set_state_changed_cb()
1023 int stt_unset_state_changed_cb(stt_h stt);
1026 * @brief Registers a callback function to be called when an error occurred.
1027 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1029 * @privilege %http://tizen.org/privilege/recorder
1031 * @param[in] stt The STT handle
1032 * @param[in] callback The callback function to register
1033 * @param[in] user_data The user data to be passed to the callback function
1035 * @return 0 on success, otherwise a negative error value
1036 * @retval #STT_ERROR_NONE Successful
1037 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1038 * @retval #STT_ERROR_INVALID_STATE Invalid state
1039 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1040 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1042 * @pre The state should be #STT_STATE_CREATED.
1044 * @see stt_error_cb()
1045 * @see stt_unset_error_cb()
1047 int stt_set_error_cb(stt_h stt, stt_error_cb callback, void* user_data);
1050 * @brief Unregisters the callback function.
1051 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1053 * @privilege %http://tizen.org/privilege/recorder
1055 * @param[in] stt The STT handle
1057 * @return 0 on success, otherwise a negative error value
1058 * @retval #STT_ERROR_NONE Successful
1059 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1060 * @retval #STT_ERROR_INVALID_STATE Invalid state
1061 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1062 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1064 * @pre The state should be #STT_STATE_CREATED.
1066 * @see stt_set_error_cb()
1068 int stt_unset_error_cb(stt_h stt);
1071 * @brief Registers a callback function to detect the default language change.
1072 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1074 * @privilege %http://tizen.org/privilege/recorder
1076 * @param[in] stt The STT handle
1077 * @param[in] callback The callback function to register
1078 * @param[in] user_data The user data to be passed to the callback function
1080 * @return 0 on success, otherwise a negative error value
1081 * @retval #STT_ERROR_NONE Successful
1082 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1083 * @retval #STT_ERROR_INVALID_STATE Invalid state
1084 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1085 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1087 * @pre The state should be #STT_STATE_CREATED.
1089 * @see stt_default_language_changed_cb()
1090 * @see stt_unset_default_language_changed_cb()
1092 int stt_set_default_language_changed_cb(stt_h stt, stt_default_language_changed_cb callback, void* user_data);
1095 * @brief Unregisters the callback function.
1096 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1098 * @privilege %http://tizen.org/privilege/recorder
1100 * @param[in] stt The STT handle
1102 * @return 0 on success, otherwise a negative error value
1103 * @retval #STT_ERROR_NONE Successful
1104 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1105 * @retval #STT_ERROR_INVALID_STATE Invalid state
1106 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1107 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1109 * @pre The state should be #STT_STATE_CREATED.
1111 * @see stt_set_default_language_changed_cb()
1113 int stt_unset_default_language_changed_cb(stt_h stt);
1116 * @brief Registers a callback function to detect the engine change.
1117 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
1119 * @param[in] stt The STT handle
1120 * @param[in] callback The callback function to register
1121 * @param[in] user_data The user data to be passed to the callback function
1123 * @return 0 on success, otherwise a negative error value
1124 * @retval #STT_ERROR_NONE Successful
1125 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1126 * @retval #STT_ERROR_INVALID_STATE Invalid state
1127 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1129 * @pre The state should be #STT_STATE_CREATED.
1131 * @see stt_engine_changed_cb()
1132 * @see stt_unset_engine_changed_cb()
1134 int stt_set_engine_changed_cb(stt_h stt, stt_engine_changed_cb callback, void* user_data);
1137 * @brief Unregisters the callback function.
1138 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
1140 * @param[in] stt The STT handle
1142 * @return 0 on success, otherwise a negative error value
1143 * @retval #STT_ERROR_NONE Successful
1144 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1145 * @retval #STT_ERROR_INVALID_STATE Invalid state
1146 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1148 * @pre The state should be #STT_STATE_CREATED.
1150 * @see stt_set_engine_changed_cb()
1152 int stt_unset_engine_changed_cb(stt_h stt);
1163 #endif /* __STT_H__ */