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 * @remarks A privilege (%http://tizen.org/privilege/appmanager.launch) is necessary since 3.0.
424 * @param[in] stt The STT handle
425 * @param[in] engine_id Engine id
427 * @return 0 on success, otherwise a negative error value
428 * @retval #STT_ERROR_NONE Success
429 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
430 * @retval #STT_ERROR_INVALID_STATE STT Not initialized
431 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
432 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
433 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
435 * @pre The state should be #STT_STATE_CREATED.
437 * @see stt_get_engine()
439 int stt_set_engine(stt_h stt, const char* engine_id);
442 * @brief Sets the app credential.
443 * @details Using this API, the application can set a credential.
444 * The credential is a key to verify the authorization about using the engine.
445 * If the application sets the credential, it will be able to use functions of the engine entirely.
446 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
448 * @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.
449 * 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.
451 * @param[in] stt The STT handle
452 * @param[in] credential The app credential
454 * @return 0 on success, otherwise a negative error value
455 * @retval #STT_ERROR_NONE Success
456 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
457 * @retval #STT_ERROR_INVALID_STATE Invalid state
458 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
460 * @pre The state should be #STT_STATE_CREATED or #STT_STATE_READY.
465 int stt_set_credential(stt_h stt, const char* credential);
468 * @brief Sets the private data to stt engine.
469 * @details The private data is the setting parameter for applying keys provided by the engine.
470 * Using this API, the application can set the private data and use the corresponding key of the engine.
471 * For example, if the engine provides 'partial recognition' as a recognition type, the application can set the private data as the following. \n
472 * int ret = stt_set_private_data(stt_h, "recognition_type", "PARTIAL");
474 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
476 * @remarks If the engine is replaced with the other engine, the key may be ignored.
478 * @param[in] stt The STT handle
479 * @param[in] key The field name of private data
480 * @param[in] data The data for set
482 * @return 0 on success, otherwise a negative error value
483 * @retval #STT_ERROR_NONE Successful
484 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
485 * @retval #STT_ERROR_INVALID_STATE Invalid state
486 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
487 * @retval #STT_ERROR_TIMED_OUT No answer from the STT service
489 * @pre The state should be #STT_STATE_READY.
491 * @see stt_get_private_data()
493 int stt_set_private_data(stt_h stt, const char* key, const char* data);
496 * @brief Gets the private data from stt engine.
497 * @details The private data is the information provided by the engine.
498 * Using this API, the application can get the private data which corresponds to the key from the engine.
500 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
502 * @remarks If the engine is replaced with the other engine, the key may be ignored.
504 * @param[in] stt The STT handle
505 * @param[in] key The field name of private data
506 * @param[out] data The data field of private data
508 * @remarks The @a data must be released using free() when it is no longer required.
510 * @return 0 on success, otherwise a negative error value
511 * @retval #STT_ERROR_NONE Successful
512 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
513 * @retval #STT_ERROR_INVALID_STATE Invalid state
514 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
515 * @retval #STT_ERROR_TIMED_OUT No answer from the STT service
517 * @pre The state should be #STT_STATE_READY.
519 * @see stt_set_private_data()
521 int stt_get_private_data(stt_h stt, const char* key, char** data);
524 * @brief Connects the STT service asynchronously.
525 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
527 * @privilege %http://tizen.org/privilege/recorder
529 * @param[in] stt The STT handle
531 * @return 0 on success, otherwise a negative error value
532 * @retval #STT_ERROR_NONE Successful
533 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
534 * @retval #STT_ERROR_INVALID_STATE Invalid state
535 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
536 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
538 * @pre The state should be #STT_STATE_CREATED.
539 * @post If this function is successful, the STT state will be #STT_STATE_READY. \n
540 * If this function is failed, the error callback is called. (e.g. #STT_ERROR_ENGINE_NOT_FOUND)
542 * @see stt_unprepare()
544 int stt_prepare(stt_h stt);
547 * @brief Disconnects the STT service.
548 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
550 * @privilege %http://tizen.org/privilege/recorder
552 * @param[in] stt The STT handle
554 * @return 0 on success, otherwise a negative error value
555 * @retval #STT_ERROR_NONE Successful
556 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
557 * @retval #STT_ERROR_INVALID_STATE Invalid state
558 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
559 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
561 * @pre The state should be #STT_STATE_READY.
562 * @post If this function is called, the STT state will be #STT_STATE_CREATED.
566 int stt_unprepare(stt_h stt);
569 * @brief Retrieves all supported languages of current engine using callback function.
570 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
572 * @privilege %http://tizen.org/privilege/recorder
574 * @param[in] stt The STT handle
575 * @param[in] callback The callback function to invoke
576 * @param[in] user_data The user data to be passed to the callback function
578 * @return 0 on success, otherwise a negative error value
579 * @retval #STT_ERROR_NONE Successful
580 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
581 * @retval #STT_ERROR_OUT_OF_MEMORY Out of memory
582 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
583 * @retval #STT_ERROR_ENGINE_NOT_FOUND No available engine
584 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
585 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
587 * @post This function invokes stt_supported_language_cb() repeatedly for getting languages.
589 * @see stt_supported_language_cb()
590 * @see stt_get_default_language()
592 int stt_foreach_supported_languages(stt_h stt, stt_supported_language_cb callback, void* user_data);
595 * @brief Gets the default language set by the user.
596 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
598 * @privilege %http://tizen.org/privilege/recorder
599 * @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
600 * For example, "ko_KR" for Korean, "en_US" for American English. \n
601 * If the function succeeds, @a language must be released using free() when it is no longer required.
603 * @param[in] stt The STT handle
604 * @param[out] language The language
606 * @return 0 on success, otherwise a negative error value
607 * @retval #STT_ERROR_NONE Successful
608 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
609 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
610 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
611 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
613 * @see stt_foreach_supported_languages()
615 int stt_get_default_language(stt_h stt, char** language);
618 * @brief Gets the current STT state.
619 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
621 * @privilege %http://tizen.org/privilege/recorder
623 * @param[in] stt The STT handle
624 * @param[out] state The current STT state
626 * @return 0 on success, otherwise a negative error value
627 * @retval #STT_ERROR_NONE Successful
628 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
629 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
630 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
635 * @see stt_state_changed_cb()
637 int stt_get_state(stt_h stt, stt_state_e* state);
640 * @brief Gets the current error message.
641 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
642 * @remarks This function should be called during an stt error callback. If not, the error as operation failure will be returned. \n
643 * If the function succeeds, @a err_msg must be released using free() when it is no longer required.
645 * @param[in] stt The STT handle
646 * @param[out] err_msg The current error message
648 * @return 0 on success, otherwise a negative error value
649 * @retval #STT_ERROR_NONE Successful
650 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
651 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
652 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
654 * @see stt_set_error_cb()
655 * @see stt_unset_error_cb()
657 int stt_get_error_message(stt_h stt, char** err_msg);
660 * @brief Checks whether the recognition type is supported.
661 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
663 * @privilege %http://tizen.org/privilege/recorder
665 * @param[in] stt The STT handle
666 * @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
667 * @param[out] support The result status @c true = supported, @c false = not supported
669 * @return 0 on success, otherwise a negative error value
670 * @retval #STT_ERROR_NONE Successful
671 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
672 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
673 * @retval #STT_ERROR_INVALID_STATE Invalid state
674 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
675 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
677 * @pre The state should be #STT_STATE_READY.
679 int stt_is_recognition_type_supported(stt_h stt, const char* type, bool* support);
682 * @brief Sets the silence detection.
683 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
685 * @privilege %http://tizen.org/privilege/recorder
687 * @param[in] stt The STT handle
688 * @param[in] type The option type
690 * @return 0 on success, otherwise a negative error value
691 * @retval #STT_ERROR_NONE Successful
692 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
693 * @retval #STT_ERROR_INVALID_STATE Invalid state
694 * @retval #STT_ERROR_NOT_SUPPORTED_FEATURE Not supported feature of current engine
695 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
696 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
698 * @pre The state should be #STT_STATE_READY.
700 int stt_set_silence_detection(stt_h stt, stt_option_silence_detection_e type);
703 * @brief Sets the sound to start recording.
704 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
706 * @privilege %http://tizen.org/privilege/recorder
708 * @remarks Sound file type should be wav type.
710 * @param[in] stt The STT handle
711 * @param[in] filename The sound file path
713 * @return 0 on success, otherwise a negative error value
714 * @retval #STT_ERROR_NONE Successful
715 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
716 * @retval #STT_ERROR_INVALID_STATE Invalid state
717 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
718 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
719 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
721 * @pre The state should be #STT_STATE_READY.
723 int stt_set_start_sound(stt_h stt, const char* filename);
726 * @brief Unsets the sound to start recording.
727 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
729 * @privilege %http://tizen.org/privilege/recorder
731 * @param[in] stt The STT handle
733 * @return 0 on success, otherwise a negative error value
734 * @retval #STT_ERROR_NONE Successful
735 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
736 * @retval #STT_ERROR_INVALID_STATE Invalid state
737 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
738 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
739 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
741 * @pre The state should be #STT_STATE_READY.
743 int stt_unset_start_sound(stt_h stt);
746 * @brief Sets the sound to stop recording.
747 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
749 * @privilege %http://tizen.org/privilege/recorder
751 * @remarks Sound file type should be wav type.
753 * @param[in] stt The STT handle
754 * @param[in] filename The sound file path
756 * @return 0 on success, otherwise a negative error value
757 * @retval #STT_ERROR_NONE Successful
758 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
759 * @retval #STT_ERROR_INVALID_STATE Invalid state
760 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
761 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
762 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
764 * @pre The state should be #STT_STATE_READY.
766 int stt_set_stop_sound(stt_h stt, const char* filename);
769 * @brief Unsets the sound to stop recording.
770 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
772 * @privilege %http://tizen.org/privilege/recorder
774 * @param[in] stt The STT handle
776 * @return 0 on success, otherwise a negative error value
777 * @retval #STT_ERROR_NONE Successful
778 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
779 * @retval #STT_ERROR_INVALID_STATE Invalid state
780 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
781 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
782 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
784 * @pre The state should be #STT_STATE_READY.
786 int stt_unset_stop_sound(stt_h stt);
789 * @brief Starts recording and recognition asynchronously.
790 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
792 * @privilege %http://tizen.org/privilege/recorder
794 * @remarks This function starts recording in the STT service and sending recording data to engine. \n
795 * This work continues until stt_stop(), stt_cancel() or silence detected by engine.
797 * @param[in] stt The STT handle
798 * @param[in] language The language selected from stt_foreach_supported_languages()
799 * @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
801 * @return 0 on success, otherwise a negative error value
802 * @retval #STT_ERROR_NONE Successful
803 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
804 * @retval #STT_ERROR_INVALID_STATE Invalid state
805 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
806 * @retval #STT_ERROR_RECORDER_BUSY Recorder busy
807 * @retval #STT_ERROR_INVALID_LANGUAGE Invalid language
808 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
809 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
810 * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
812 * @pre The state should be #STT_STATE_READY.
813 * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
814 * If this function succeeds, the STT state will be #STT_STATE_RECORDING.
815 * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_RECORDING.
819 * @see stt_state_changed_cb()
821 int stt_start(stt_h stt, const char* language, const char* type);
824 * @brief Finishes the recording and starts recognition processing in engine asynchronously.
825 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
827 * @privilege %http://tizen.org/privilege/recorder
829 * @param[in] stt The STT handle
831 * @return 0 on success, otherwise a negative error value
832 * @retval #STT_ERROR_NONE Successful
833 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
834 * @retval #STT_ERROR_INVALID_STATE Invalid state
835 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
836 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
837 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
838 * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
839 * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
840 * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
842 * @pre The state should be #STT_STATE_RECORDING.
843 * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
844 * If this function succeeds, the STT state will be #STT_STATE_PROCESSING. \n
845 * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_PROCESSING.
846 * After processing of engine, stt_result_cb() is called.
850 * @see stt_state_changed_cb()
852 int stt_stop(stt_h stt);
855 * @brief Cancels processing recognition and recording asynchronously.
856 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
858 * @privilege %http://tizen.org/privilege/recorder
860 * @remarks This function cancels recording and engine cancels recognition processing. \n
861 * After successful cancel, stt_state_changed_cb() is called otherwise if error is occurred, stt_error_cb() is called.
863 * @param[in] stt The STT handle
865 * @return 0 on success, otherwise a negative error value
866 * @retval #STT_ERROR_NONE Successful
867 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
868 * @retval #STT_ERROR_INVALID_STATE Invalid state
869 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
870 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
871 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
872 * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
873 * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
874 * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
876 * @pre The state should be #STT_STATE_RECORDING or #STT_STATE_PROCESSING.
877 * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
878 * If this function succeeds, the STT state will be #STT_STATE_READY.
879 * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_READY.
883 * @see stt_state_changed_cb()
885 int stt_cancel(stt_h stt);
888 * @brief Gets the microphone volume during recording.
889 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
891 * @privilege %http://tizen.org/privilege/recorder
893 * @param[in] stt The STT handle
894 * @param[out] volume Recording volume
896 * @return 0 on success, otherwise a negative error value
897 * @retval #STT_ERROR_NONE Successful
898 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
899 * @retval #STT_ERROR_INVALID_STATE Invalid state
900 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
901 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
902 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
904 * @pre The state should be #STT_STATE_RECORDING.
908 int stt_get_recording_volume(stt_h stt, float* volume);
911 * @brief Retrieves the time stamp of the current recognition result using the callback function.
912 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
914 * @privilege %http://tizen.org/privilege/recorder
916 * @remarks This function should be called in stt_recognition_result_cb().
917 * After stt_recognition_result_cb(), result data is NOT valid.
919 * @param[in] stt The STT handle
920 * @param[in] callback The callback function to invoke
921 * @param[in] user_data The user data to be passed to the callback function
923 * @return 0 on success, otherwise a negative error value
924 * @retval #STT_ERROR_NONE Successful
925 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
926 * @retval #STT_ERROR_OPERATION_FAILED Operation failure
927 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
928 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
930 * @pre This function should be called in stt_recognition_result_cb().
931 * @post This function invokes stt_result_time_cb() repeatedly for getting time information.
933 * @see stt_result_time_cb()
934 * @see stt_recognition_result_cb()
936 int stt_foreach_detailed_result(stt_h stt, stt_result_time_cb callback, void* user_data);
939 * @brief Registers a callback function to get the recognition result.
940 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
942 * @privilege %http://tizen.org/privilege/recorder
944 * @param[in] stt The STT handle
945 * @param[in] callback The callback function to register
946 * @param[in] user_data The user data to be passed to the callback function
948 * @return 0 on success, otherwise a negative error value
949 * @retval #STT_ERROR_NONE Successful
950 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
951 * @retval #STT_ERROR_INVALID_STATE Invalid state
952 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
953 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
955 * @pre The state should be #STT_STATE_CREATED.
957 * @see stt_recognition_result_cb()
958 * @see stt_unset_recognition_result_cb()
960 int stt_set_recognition_result_cb(stt_h stt, stt_recognition_result_cb callback, void* user_data);
963 * @brief Unregisters the callback function.
964 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
966 * @privilege %http://tizen.org/privilege/recorder
968 * @param[in] stt The STT handle
970 * @return 0 on success, otherwise a negative error value
971 * @retval #STT_ERROR_NONE Successful
972 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
973 * @retval #STT_ERROR_INVALID_STATE Invalid state
974 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
975 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
977 * @pre The state should be #STT_STATE_CREATED.
979 * @see stt_set_recognition_result_cb()
981 int stt_unset_recognition_result_cb(stt_h stt);
984 * @brief Registers a callback function to be called when STT state changes.
985 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
987 * @privilege %http://tizen.org/privilege/recorder
989 * @param[in] stt The STT handle
990 * @param[in] callback The callback function to register
991 * @param[in] user_data The user data to be passed to the callback function
993 * @return 0 on success, otherwise a negative error value
994 * @retval #STT_ERROR_NONE Successful
995 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
996 * @retval #STT_ERROR_INVALID_STATE Invalid state
997 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
998 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1000 * @pre The state should be #STT_STATE_CREATED.
1002 * @see stt_state_changed_cb()
1003 * @see stt_unset_state_changed_cb()
1005 int stt_set_state_changed_cb(stt_h stt, stt_state_changed_cb callback, void* user_data);
1008 * @brief Unregisters the callback function.
1009 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1011 * @privilege %http://tizen.org/privilege/recorder
1013 * @param[in] stt The STT handle
1015 * @return 0 on success, otherwise a negative error value
1016 * @retval #STT_ERROR_NONE Successful
1017 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1018 * @retval #STT_ERROR_INVALID_STATE Invalid state
1019 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1020 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1022 * @pre The state should be #STT_STATE_CREATED.
1024 * @see stt_set_state_changed_cb()
1026 int stt_unset_state_changed_cb(stt_h stt);
1029 * @brief Registers a callback function to be called when an error occurred.
1030 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1032 * @privilege %http://tizen.org/privilege/recorder
1034 * @param[in] stt The STT handle
1035 * @param[in] callback The callback function to register
1036 * @param[in] user_data The user data to be passed to the callback function
1038 * @return 0 on success, otherwise a negative error value
1039 * @retval #STT_ERROR_NONE Successful
1040 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1041 * @retval #STT_ERROR_INVALID_STATE Invalid state
1042 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1043 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1045 * @pre The state should be #STT_STATE_CREATED.
1047 * @see stt_error_cb()
1048 * @see stt_unset_error_cb()
1050 int stt_set_error_cb(stt_h stt, stt_error_cb callback, void* user_data);
1053 * @brief Unregisters the callback function.
1054 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1056 * @privilege %http://tizen.org/privilege/recorder
1058 * @param[in] stt The STT handle
1060 * @return 0 on success, otherwise a negative error value
1061 * @retval #STT_ERROR_NONE Successful
1062 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1063 * @retval #STT_ERROR_INVALID_STATE Invalid state
1064 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1065 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1067 * @pre The state should be #STT_STATE_CREATED.
1069 * @see stt_set_error_cb()
1071 int stt_unset_error_cb(stt_h stt);
1074 * @brief Registers a callback function to detect the default language change.
1075 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1077 * @privilege %http://tizen.org/privilege/recorder
1079 * @param[in] stt The STT handle
1080 * @param[in] callback The callback function to register
1081 * @param[in] user_data The user data to be passed to the callback function
1083 * @return 0 on success, otherwise a negative error value
1084 * @retval #STT_ERROR_NONE Successful
1085 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1086 * @retval #STT_ERROR_INVALID_STATE Invalid state
1087 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1088 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1090 * @pre The state should be #STT_STATE_CREATED.
1092 * @see stt_default_language_changed_cb()
1093 * @see stt_unset_default_language_changed_cb()
1095 int stt_set_default_language_changed_cb(stt_h stt, stt_default_language_changed_cb callback, void* user_data);
1098 * @brief Unregisters the callback function.
1099 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1101 * @privilege %http://tizen.org/privilege/recorder
1103 * @param[in] stt The STT handle
1105 * @return 0 on success, otherwise a negative error value
1106 * @retval #STT_ERROR_NONE Successful
1107 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1108 * @retval #STT_ERROR_INVALID_STATE Invalid state
1109 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1110 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
1112 * @pre The state should be #STT_STATE_CREATED.
1114 * @see stt_set_default_language_changed_cb()
1116 int stt_unset_default_language_changed_cb(stt_h stt);
1119 * @brief Registers a callback function to detect the engine change.
1120 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
1122 * @param[in] stt The STT handle
1123 * @param[in] callback The callback function to register
1124 * @param[in] user_data The user data to be passed to the callback function
1126 * @return 0 on success, otherwise a negative error value
1127 * @retval #STT_ERROR_NONE Successful
1128 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1129 * @retval #STT_ERROR_INVALID_STATE Invalid state
1130 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1132 * @pre The state should be #STT_STATE_CREATED.
1134 * @see stt_engine_changed_cb()
1135 * @see stt_unset_engine_changed_cb()
1137 int stt_set_engine_changed_cb(stt_h stt, stt_engine_changed_cb callback, void* user_data);
1140 * @brief Unregisters the callback function.
1141 * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
1143 * @param[in] stt The STT handle
1145 * @return 0 on success, otherwise a negative error value
1146 * @retval #STT_ERROR_NONE Successful
1147 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1148 * @retval #STT_ERROR_INVALID_STATE Invalid state
1149 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1151 * @pre The state should be #STT_STATE_CREATED.
1153 * @see stt_set_engine_changed_cb()
1155 int stt_unset_engine_changed_cb(stt_h stt);
1166 #endif /* __STT_H__ */