Add restore logic when daemon get signal
[platform/core/uifw/stt.git] / include / stt.h
1 /*
2  * Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __STT_H__
18 #define __STT_H__
19
20 #include <tizen.h>
21
22 /**
23  * @file stt.h
24  */
25
26 /**
27 * @addtogroup CAPI_UIX_STT_MODULE
28 * @{
29 */
30
31 #ifdef __cplusplus
32 extern "C"
33 {
34 #endif
35
36 /**
37  * @brief Enumerations for error codes.
38  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
39 */
40 typedef enum {
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 daemon */
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_NO_SPEECH                     = TIZEN_ERROR_STT | 0x06,       /**< No speech while recording */
56         STT_ERROR_IN_PROGRESS_TO_READY          = TIZEN_ERROR_STT | 0x07,       /**< Progress to ready is not finished */
57         STT_ERROR_IN_PROGRESS_TO_RECORDING      = TIZEN_ERROR_STT | 0x08,       /**< Progress to recording is not finished */
58         STT_ERROR_IN_PROGRESS_TO_PROCESSING     = TIZEN_ERROR_STT | 0x09,       /**< Progress to processing is not finished */
59         STT_ERROR_RECORDING_TIMED_OUT           = TIZEN_ERROR_STT | 0x10,       /**< Recording timed out */
60         STT_ERROR_SERVICE_RESET                 = TIZEN_ERROR_STT | 0x11        /**< Service reset */
61 } stt_error_e;
62
63 /**
64  * @brief Definition for free form dictation and default type.
65  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
66 */
67 #define STT_RECOGNITION_TYPE_FREE               "stt.recognition.type.FREE"
68
69 /**
70  * @brief Definition for continuous free dictation.
71  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
72 */
73 #define STT_RECOGNITION_TYPE_FREE_PARTIAL       "stt.recognition.type.FREE.PARTIAL"
74
75 /**
76  * @brief Definition for search.
77  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
78 */
79 #define STT_RECOGNITION_TYPE_SEARCH             "stt.recognition.type.SEARCH"
80
81 /**
82  * @brief Definition for web search.
83  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
84 */
85 #define STT_RECOGNITION_TYPE_WEB_SEARCH         "stt.recognition.type.WEB_SEARCH"
86
87 /**
88  * @brief Definition for map.
89  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
90 */
91 #define STT_RECOGNITION_TYPE_MAP                "stt.recognition.type.MAP"
92
93 /**
94  * @brief Definition for none message.
95  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
96 */
97 #define STT_RESULT_MESSAGE_NONE                 "stt.result.message.none"
98
99 /**
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
102 */
103 #define STT_RESULT_MESSAGE_ERROR_TOO_SOON       "stt.result.message.error.too.soon"
104
105 /**
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
108 */
109 #define STT_RESULT_MESSAGE_ERROR_TOO_SHORT      "stt.result.message.error.too.short"
110
111 /**
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
114 */
115 #define STT_RESULT_MESSAGE_ERROR_TOO_LONG       "stt.result.message.error.too.long"
116
117 /**
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
120 */
121 #define STT_RESULT_MESSAGE_ERROR_TOO_QUIET      "stt.result.message.error.too.quiet"
122
123 /**
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
126 */
127 #define STT_RESULT_MESSAGE_ERROR_TOO_LOUD       "stt.result.message.error.too.loud"
128
129 /**
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
132 */
133 #define STT_RESULT_MESSAGE_ERROR_TOO_FAST       "stt.result.message.error.too.fast"
134
135
136 /**
137  * @brief Enumeration for state.
138  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
139 */
140 typedef enum {
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*/
145 } stt_state_e;
146
147 /**
148  * @brief Enumeration for result event.
149  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
150 */
151 typedef enum {
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;
156
157 /**
158  * @brief Enumeration for result time callback event.
159  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
160 */
161 typedef enum {
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;
166
167 /**
168  * @brief Enumeration for silence detection type.
169  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
170 */
171 typedef enum {
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;
176
177 /**
178  * @brief A structure of STT handler.
179  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
180 */
181 typedef struct stt_s *stt_h;
182
183 /**
184  * @brief Called to get the engine information.
185  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
186  *
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()
190  *
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.
193  *
194  * @see stt_foreach_supported_engines()
195 */
196 typedef bool(*stt_supported_engine_cb)(stt_h stt, const char* engine_id, const char* engine_name, void* user_data);
197
198 /**
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
201  *
202  * @remarks After stt_stop() is called, silence is detected from recording, or partial result is occured,
203  *      this function is called.
204  *
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
211  *
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.
214  *
215  * @see stt_stop()
216  * @see stt_set_recognition_result_cb()
217  * @see stt_unset_recognition_result_cb()
218 */
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);
221
222 /**
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
225  *
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
233  *
234  * @return @c true to continue with the next iteration of the loop \n @c false to break out of the loop
235  *
236  * @pre stt_recognition_result_cb() should be called.
237  *
238  * @see stt_recognition_result_cb()
239 */
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);
242
243 /**
244  * @brief Called when the state of STT is changed.
245  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
246  *
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
251  *
252  * @pre An application registers this callback using stt_set_state_changed_cb() to detect changing state.
253  *
254  * @see stt_set_state_changed_cb()
255  * @see stt_unset_state_changed_cb()
256 */
257 typedef void (*stt_state_changed_cb)(stt_h stt, stt_state_e previous, stt_state_e current, void* user_data);
258
259 /**
260  * @brief Called when an error occurs.
261  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
262  *
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
266  *
267  * @pre An application registers this callback using stt_set_error_cb() to detect error.
268  *
269  * @see stt_set_error_cb()
270  * @see stt_unset_error_cb()
271 */
272 typedef void (*stt_error_cb)(stt_h stt, stt_error_e reason, void *user_data);
273
274 /**
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.
278  *
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
282  *
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.
285  *
286  * @see stt_foreach_supported_languages()
287 */
288 typedef bool (*stt_supported_language_cb)(stt_h stt, const char* language, void* user_data);
289
290 /**
291  * @brief Called when the default language is changed.
292  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
293  *
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
298  *
299  * @see stt_set_default_language_changed_cb()
300 */
301 typedef void (*stt_default_language_changed_cb)(stt_h stt, const char* previous_language,
302                                                 const char* current_language, void* user_data);
303
304 /**
305  * @brief Called when the engine is changed.
306  * @since_tizen 3.0
307  *
308  * @param[in] stt The STT handle
309  * @param[in] engine_id Engine id
310  * @param[in] language The default language
311  * @param[in] support_silence support silence detection
312  * @param[in] need_credential necessity of credential
313  * @param[in] user_data The user data passed from the callback registration function
314  *
315  * @see stt_set_engine_changed_cb()
316 */
317 typedef bool (*stt_engine_changed_cb)(stt_h stt, const char* engine_id, const char* language,
318                                                 bool support_silence, bool need_credential, void* user_data);
319
320 /**
321  * @brief Creates a STT handle.
322  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
323  * @privlevel public
324  * @privilege %http://tizen.org/privilege/recorder
325  *
326  * @remarks If the function succeeds, @a stt handle must be released with stt_destroy().
327  *
328  * @param[out] stt The STT handle
329  *
330  * @return 0 on success, otherwise a negative error value
331  * @retval #STT_ERROR_NONE Successful
332  * @retval #STT_ERROR_OUT_OF_MEMORY Out of memory
333  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
334  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
335  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
336  *
337  * @post If this function is called, the STT state will be #STT_STATE_CREATED.
338  *
339  * @see stt_destroy()
340 */
341 int stt_create(stt_h* stt);
342
343 /**
344  * @brief Destroys a STT handle.
345  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
346  * @privlevel public
347  * @privilege %http://tizen.org/privilege/recorder
348  *
349  * @param[in] stt The STT handle
350  *
351  * @return 0 on success, otherwise a negative error value
352  * @retval #STT_ERROR_NONE Successful
353  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
354  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
355  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
356  *
357  * @see stt_create()
358 */
359 int stt_destroy(stt_h stt);
360
361 /**
362  * @brief Retrieves supported engine information using a callback function.
363  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
364  * @privlevel public
365  * @privilege %http://tizen.org/privilege/recorder
366  *
367  * @param[in] stt The STT handle
368  * @param[in] callback The callback function to invoke
369  * @param[in] user_data The user data to be passed to the callback function
370  *
371  * @return 0 on success, otherwise a negative error value
372  * @retval #STT_ERROR_NONE Success
373  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
374  * @retval #STT_ERROR_INVALID_STATE STT Not initialized
375  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
376  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
377  *
378  * @pre The state should be #STT_STATE_CREATED.
379  * @post This function invokes stt_supported_engine_cb() repeatedly for getting engine information.
380  *
381  * @see stt_supported_engine_cb()
382 */
383 int stt_foreach_supported_engines(stt_h stt, stt_supported_engine_cb callback, void* user_data);
384
385 /**
386  * @brief Gets the current engine id.
387  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
388  * @privlevel public
389  * @privilege %http://tizen.org/privilege/recorder
390  *
391  * @remarks If the function is success, @a engine_id must be released using free().
392  *
393  * @param[in] stt The STT handle
394  * @param[out] engine_id Engine id
395  *
396  * @return 0 on success, otherwise a negative error value
397  * @retval #STT_ERROR_NONE Success
398  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
399  * @retval #STT_ERROR_INVALID_STATE STT Not initialized
400  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
401  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
402  *
403  * @pre The state should be #STT_STATE_CREATED.
404  *
405  * @see stt_set_engine()
406 */
407 int stt_get_engine(stt_h stt, char** engine_id);
408
409 /**
410  * @brief Sets the engine id.
411  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
412  * @privlevel public
413  * @privilege %http://tizen.org/privilege/recorder
414  *
415  * @param[in] stt The STT handle
416  * @param[in] engine_id Engine id
417  *
418  * @return 0 on success, otherwise a negative error value
419  * @retval #STT_ERROR_NONE Success
420  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
421  * @retval #STT_ERROR_INVALID_STATE STT Not initialized
422  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
423  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
424  *
425  * @pre The state should be #STT_STATE_CREATED.
426  *
427  * @see stt_get_engine()
428 */
429 int stt_set_engine(stt_h stt, const char* engine_id);
430
431 /**
432  * @brief Sets the app credential.
433  * @since_tizen 3.0
434  * @privlevel public
435  * @privilege %http://tizen.org/privilege/recorder
436  *
437  * @param[in] stt The STT handle
438  * @param[in] credential The app credential
439  *
440  * @return 0 on success, otherwise a negative error value
441  * @retval #STT_ERROR_NONE Success
442  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
443  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
444  *
445  * @pre The state should be #STT_STATE_CREATED or #STT_STATE_READY.
446  *
447  * @see stt_start()
448 */
449
450 int stt_set_credential(stt_h stt, const char* credential);
451
452 /**
453  * @brief Sets the private data to stt engine.
454  * @since_tizen 3.0
455  *
456  * @param[in] stt The STT handle
457  * @param[in] key The field name of private data
458  * @param[in] data The data for set
459  *
460  * @return 0 on success, otherwise a negative error value
461  * @retval #STT_ERROR_NONE Successful
462  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
463  * @retval #STT_ERROR_INVALID_STATE Invalid state
464  * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
465  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
466  * @retval #STT_ERROR_TIMED_OUT No answer from the daemon
467  *
468  * @pre The state should be #STT_STATE_READY.
469  *
470  * @see stt_get_private_data()
471 */
472 int stt_set_private_data(stt_h stt, const char* key, const char* data);
473
474 /**
475  * @brief Gets the private data from stt engine.
476  * @since_tizen 3.0
477  *
478  * @param[in] stt The STT handle
479  * @param[in] key The field name of private data
480  * @param[out] data The data
481  *
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_PERMISSION_DENIED Permission denied
487  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
488  * @retval #STT_ERROR_TIMED_OUT No answer from the daemon
489  *
490  * @pre The state should be #STT_STATE_READY.
491  *
492  * @see stt_set_private_data()
493 */
494 int stt_get_private_data(stt_h stt, const char* key, char** data);
495
496 /**
497  * @brief Connects the daemon asynchronously.
498  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
499  * @privlevel public
500  * @privilege %http://tizen.org/privilege/recorder
501  *
502  * @param[in] stt The STT handle
503  *
504  * @return 0 on success, otherwise a negative error value
505  * @retval #STT_ERROR_NONE Successful
506  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
507  * @retval #STT_ERROR_INVALID_STATE Invalid state
508  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
509  *
510  * @pre The state should be #STT_STATE_CREATED.
511  * @post If this function is successful, the STT state will be #STT_STATE_READY. \n
512  *      If this function is failed, the error callback is called. (e.g. #STT_ERROR_ENGINE_NOT_FOUND)
513  *
514  * @see stt_unprepare()
515 */
516 int stt_prepare(stt_h stt);
517
518 /**
519  * @brief Disconnects the daemon.
520  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
521  * @privlevel public
522  * @privilege %http://tizen.org/privilege/recorder
523  *
524  * @param[in] stt The STT handle
525  *
526  * @return 0 on success, otherwise a negative error value
527  * @retval #STT_ERROR_NONE Successful
528  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
529  * @retval #STT_ERROR_INVALID_STATE Invalid state
530  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
531  *
532  * @pre The state should be #STT_STATE_READY.
533  * @post If this function is called, the STT state will be #STT_STATE_CREATED.
534  *
535  * @see stt_prepare()
536 */
537 int stt_unprepare(stt_h stt);
538
539 /**
540  * @brief Retrieves all supported languages of current engine using callback function.
541  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
542  * @privlevel public
543  * @privilege %http://tizen.org/privilege/recorder
544  *
545  * @param[in] stt The STT handle
546  * @param[in] callback The callback function to invoke
547  * @param[in] user_data The user data to be passed to the callback function
548  *
549  * @return 0 on success, otherwise a negative error value
550  * @retval #STT_ERROR_NONE Successful
551  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
552  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
553  * @retval #STT_ERROR_ENGINE_NOT_FOUND No available engine
554  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
555  *
556  * @post This function invokes stt_supported_language_cb() repeatedly for getting languages.
557  *
558  * @see stt_supported_language_cb()
559  * @see stt_get_default_language()
560 */
561 int stt_foreach_supported_languages(stt_h stt, stt_supported_language_cb callback, void* user_data);
562
563 /**
564  * @brief Gets the default language set by the user.
565  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
566  * @privlevel public
567  * @privilege %http://tizen.org/privilege/recorder
568  * @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
569  * For example, "ko_KR" for Korean, "en_US" for American English. \n
570  * If the function succeeds, @a language must be released using free() when it is no longer required.
571  *
572  * @param[in] stt The STT handle
573  * @param[out] language The language
574  *
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_OPERATION_FAILED Operation failure
579  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
580  *
581  * @see stt_foreach_supported_languages()
582 */
583 int stt_get_default_language(stt_h stt, char** language);
584
585 /**
586  * @brief Gets the current STT state.
587  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
588  * @privlevel public
589  * @privilege %http://tizen.org/privilege/recorder
590  *
591  * @param[in] stt The STT handle
592  * @param[out] state The current STT state
593  *
594  * @return 0 on success, otherwise a negative error value
595  * @retval #STT_ERROR_NONE Successful
596  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
597  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
598  *
599  * @see stt_start()
600  * @see stt_stop()
601  * @see stt_cancel()
602  * @see stt_state_changed_cb()
603 */
604 int stt_get_state(stt_h stt, stt_state_e* state);
605
606 /**
607  * @brief Gets the current error message.
608  * @since_tizen 3.0
609  * @privlevel public
610  * @privilege %http://tizen.org/privilege/recorder
611  * @remarks This function should be called during an stt error callback. If not, the error as operation failure will be returned. \n
612  * If the function succeeds, @a err_msg must be released using free() when it is no longer required.
613  *
614  * @param[in] stt The STT handle
615  * @param[out] err_msg The current error message
616  *
617  * @return 0 on success, otherwise a negative error value
618  * @retval #STT_ERROR_NONE Successful
619  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
620  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
621  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
622  *
623  * @see stt_set_error_cb()
624  * @see stt_unset_error_cb()
625 */
626 int stt_get_error_message(stt_h stt, char** err_msg);
627
628 /**
629  * @brief Checks whether the recognition type is supported.
630  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
631  * @privlevel public
632  * @privilege %http://tizen.org/privilege/recorder
633  *
634  * @param[in] stt The STT handle
635  * @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
636  * @param[out] support The result status @c true = supported, @c false = not supported
637  *
638  * @return 0 on success, otherwise a negative error value
639  * @retval #STT_ERROR_NONE Successful
640  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
641  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
642  * @retval #STT_ERROR_INVALID_STATE Invalid state
643  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
644  *
645  * @pre The state should be #STT_STATE_READY.
646 */
647 int stt_is_recognition_type_supported(stt_h stt, const char* type, bool* support);
648
649 /**
650  * @brief Sets the silence detection.
651  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
652  * @privlevel public
653  * @privilege %http://tizen.org/privilege/recorder
654  *
655  * @param[in] stt The STT handle
656  * @param[in] type The option type
657  *
658  * @return 0 on success, otherwise a negative error value
659  * @retval #STT_ERROR_NONE Successful
660  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
661  * @retval #STT_ERROR_INVALID_STATE Invalid state
662  * @retval #STT_ERROR_NOT_SUPPORTED_FEATURE Not supported feature of current engine
663  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
664  *
665  * @pre The state should be #STT_STATE_READY.
666 */
667 int stt_set_silence_detection(stt_h stt, stt_option_silence_detection_e type);
668
669 /**
670  * @brief Sets the sound to start recording.
671  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
672  * @privlevel public
673  * @privilege %http://tizen.org/privilege/recorder
674  *
675  * @remarks Sound file type should be wav type.
676  *
677  * @param[in] stt The STT handle
678  * @param[in] filename The sound file path
679  *
680  * @return 0 on success, otherwise a negative error value
681  * @retval #STT_ERROR_NONE Successful
682  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
683  * @retval #STT_ERROR_INVALID_STATE Invalid state
684  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
685  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
686  *
687  * @pre The state should be #STT_STATE_READY.
688 */
689 int stt_set_start_sound(stt_h stt, const char* filename);
690
691 /**
692  * @brief Unsets the sound to start recording.
693  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
694  * @privlevel public
695  * @privilege %http://tizen.org/privilege/recorder
696  *
697  * @param[in] stt The STT handle
698  *
699  * @return 0 on success, otherwise a negative error value
700  * @retval #STT_ERROR_NONE Successful
701  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
702  * @retval #STT_ERROR_INVALID_STATE Invalid state
703  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
704  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
705  *
706  * @pre The state should be #STT_STATE_READY.
707 */
708 int stt_unset_start_sound(stt_h stt);
709
710 /**
711  * @brief Sets the sound to stop recording.
712  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
713  * @privlevel public
714  * @privilege %http://tizen.org/privilege/recorder
715  *
716  * @remarks Sound file type should be wav type.
717  *
718  * @param[in] stt The STT handle
719  * @param[in] filename The sound file path
720  *
721  * @return 0 on success, otherwise a negative error value
722  * @retval #STT_ERROR_NONE Successful
723  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
724  * @retval #STT_ERROR_INVALID_STATE Invalid state
725  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
726  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
727  *
728  * @pre The state should be #STT_STATE_READY.
729 */
730 int stt_set_stop_sound(stt_h stt, const char* filename);
731
732 /**
733  * @brief Unsets the sound to stop recording.
734  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
735  * @privlevel public
736  * @privilege %http://tizen.org/privilege/recorder
737  *
738  * @param[in] stt The STT handle
739  *
740  * @return 0 on success, otherwise a negative error value
741  * @retval #STT_ERROR_NONE Successful
742  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
743  * @retval #STT_ERROR_INVALID_STATE Invalid state
744  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
745  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
746  *
747  * @pre The state should be #STT_STATE_READY.
748 */
749 int stt_unset_stop_sound(stt_h stt);
750
751 /**
752  * @brief Starts recording and recognition asynchronously.
753  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
754  * @privlevel public
755  * @privilege %http://tizen.org/privilege/recorder
756  *
757  * @remarks This function starts recording in the daemon and sending recording data to engine. \n
758  * This work continues until stt_stop(), stt_cancel() or silence detected by engine.
759  *
760  * @param[in] stt The STT handle
761  * @param[in] language The language selected from stt_foreach_supported_languages()
762  * @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
763  *
764  * @return 0 on success, otherwise a negative error value
765  * @retval #STT_ERROR_NONE Successful
766  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
767  * @retval #STT_ERROR_INVALID_STATE Invalid state
768  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
769  * @retval #STT_ERROR_RECORDER_BUSY Recorder busy
770  * @retval #STT_ERROR_INVALID_LANGUAGE Invalid language
771  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
772  * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
773  *
774  * @pre The state should be #STT_STATE_READY.
775  * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
776  * If this function succeeds, the STT state will be #STT_STATE_RECORDING.
777  * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_RECORDING.
778  *
779  * @see stt_stop()
780  * @see stt_cancel()
781  * @see stt_state_changed_cb()
782 */
783 int stt_start(stt_h stt, const char* language, const char* type);
784
785 /**
786  * @brief Finishes the recording and starts recognition processing in engine asynchronously.
787  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
788  * @privlevel public
789  * @privilege %http://tizen.org/privilege/recorder
790  *
791  * @param[in] stt The STT handle
792  *
793  * @return 0 on success, otherwise a negative error value
794  * @retval #STT_ERROR_NONE Successful
795  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
796  * @retval #STT_ERROR_INVALID_STATE Invalid state
797  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
798  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
799  * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
800  * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
801  * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
802  *
803  * @pre The state should be #STT_STATE_RECORDING.
804  * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
805  * If this function succeeds, the STT state will be #STT_STATE_PROCESSING. \n
806  * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_PROCESSING.
807  * After processing of engine, stt_result_cb() is called.
808  *
809  * @see stt_start()
810  * @see stt_cancel()
811  * @see stt_state_changed_cb()
812 */
813 int stt_stop(stt_h stt);
814
815 /**
816  * @brief Cancels processing recognition and recording asynchronously.
817  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
818  * @privlevel public
819  * @privilege %http://tizen.org/privilege/recorder
820  *
821  * @remarks This function cancels recording and engine cancels recognition processing. \n
822  * After successful cancel, stt_state_changed_cb() is called otherwise if error is occurred, stt_error_cb() is called.
823  *
824  * @param[in] stt The STT handle
825  *
826  * @return 0 on success, otherwise a negative error value
827  * @retval #STT_ERROR_NONE Successful
828  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
829  * @retval #STT_ERROR_INVALID_STATE Invalid state
830  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
831  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
832  * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
833  * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
834  * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
835  *
836  * @pre The state should be #STT_STATE_RECORDING or #STT_STATE_PROCESSING.
837  * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
838  * If this function succeeds, the STT state will be #STT_STATE_READY.
839  * If you call this function again before state changes, you will receive STT_ERROR_IN_PROGRESS_TO_READY.
840  *
841  * @see stt_start()
842  * @see stt_stop()
843  * @see stt_state_changed_cb()
844 */
845 int stt_cancel(stt_h stt);
846
847 /**
848  * @brief Gets the microphone volume during recording.
849  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
850  * @privlevel public
851  * @privilege %http://tizen.org/privilege/recorder
852  *
853  * @param[in] stt The STT handle
854  * @param[out] volume Recording volume
855  *
856  * @return 0 on success, otherwise a negative error value
857  * @retval #STT_ERROR_NONE Successful
858  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
859  * @retval #STT_ERROR_INVALID_STATE Invalid state
860  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
861  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
862  *
863  * @pre The state should be #STT_STATE_RECORDING.
864  *
865  * @see stt_start()
866 */
867 int stt_get_recording_volume(stt_h stt, float* volume);
868
869 /**
870  * @brief Retrieves the time stamp of the current recognition result using the callback function.
871  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
872  * @privlevel public
873  * @privilege %http://tizen.org/privilege/recorder
874  *
875  * @remarks This function should be called in stt_recognition_result_cb().
876  *      After stt_recognition_result_cb(), result data is NOT valid.
877  *
878  * @param[in] stt The STT handle
879  * @param[in] callback The callback function to invoke
880  * @param[in] user_data The user data to be passed to the callback function
881  *
882  * @return 0 on success, otherwise a negative error value
883  * @retval #STT_ERROR_NONE Successful
884  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
885  * @retval #STT_ERROR_OPERATION_FAILED Operation failure
886  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
887  *
888  * @pre This function should be called in stt_recognition_result_cb().
889  * @post This function invokes stt_result_time_cb() repeatedly for getting time information.
890  *
891  * @see stt_result_time_cb()
892  * @see stt_recognition_result_cb()
893 */
894 int stt_foreach_detailed_result(stt_h stt, stt_result_time_cb callback, void* user_data);
895
896 /**
897  * @brief Registers a callback function to get the recognition result.
898  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
899  * @privlevel public
900  * @privilege %http://tizen.org/privilege/recorder
901  *
902  * @param[in] stt The STT handle
903  * @param[in] callback The callback function to register
904  * @param[in] user_data The user data to be passed to the callback function
905  *
906  * @return 0 on success, otherwise a negative error value
907  * @retval #STT_ERROR_NONE Successful
908  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
909  * @retval #STT_ERROR_INVALID_STATE Invalid state
910  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
911  *
912  * @pre The state should be #STT_STATE_CREATED.
913  *
914  * @see stt_recognition_result_cb()
915  * @see stt_unset_recognition_result_cb()
916 */
917 int stt_set_recognition_result_cb(stt_h stt, stt_recognition_result_cb callback, void* user_data);
918
919 /**
920  * @brief Unregisters the callback function.
921  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
922  * @privlevel public
923  * @privilege %http://tizen.org/privilege/recorder
924  *
925  * @param[in] stt The STT handle
926  *
927  * @return 0 on success, otherwise a negative error value
928  * @retval #STT_ERROR_NONE Successful
929  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
930  * @retval #STT_ERROR_INVALID_STATE Invalid state
931  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
932  *
933  * @pre The state should be #STT_STATE_CREATED.
934  *
935  * @see stt_set_recognition_result_cb()
936 */
937 int stt_unset_recognition_result_cb(stt_h stt);
938
939 /**
940  * @brief Registers a callback function to be called when STT state changes.
941  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
942  * @privlevel public
943  * @privilege %http://tizen.org/privilege/recorder
944  *
945  * @param[in] stt The STT handle
946  * @param[in] callback The callback function to register
947  * @param[in] user_data The user data to be passed to the callback function
948  *
949  * @return 0 on success, otherwise a negative error value
950  * @retval #STT_ERROR_NONE Successful
951  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
952  * @retval #STT_ERROR_INVALID_STATE Invalid state
953  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
954  *
955  * @pre The state should be #STT_STATE_CREATED.
956  *
957  * @see stt_state_changed_cb()
958  * @see stt_unset_state_changed_cb()
959 */
960 int stt_set_state_changed_cb(stt_h stt, stt_state_changed_cb callback, void* user_data);
961
962 /**
963  * @brief Unregisters the callback function.
964  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
965  * @privlevel public
966  * @privilege %http://tizen.org/privilege/recorder
967  *
968  * @param[in] stt The STT handle
969  *
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  *
976  * @pre The state should be #STT_STATE_CREATED.
977  *
978  * @see stt_set_state_changed_cb()
979 */
980 int stt_unset_state_changed_cb(stt_h stt);
981
982 /**
983  * @brief Registers a callback function to be called when an error occurred.
984  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
985  * @privlevel public
986  * @privilege %http://tizen.org/privilege/recorder
987  *
988  * @param[in] stt The STT handle
989  * @param[in] callback The callback function to register
990  * @param[in] user_data The user data to be passed to the callback function
991  *
992  * @return 0 on success, otherwise a negative error value
993  * @retval #STT_ERROR_NONE Successful
994  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
995  * @retval #STT_ERROR_INVALID_STATE Invalid state
996  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
997  *
998  * @pre The state should be #STT_STATE_CREATED.
999  *
1000  * @see stt_error_cb()
1001  * @see stt_unset_error_cb()
1002 */
1003 int stt_set_error_cb(stt_h stt, stt_error_cb callback, void* user_data);
1004
1005 /**
1006  * @brief Unregisters the callback function.
1007  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1008  * @privlevel public
1009  * @privilege %http://tizen.org/privilege/recorder
1010  *
1011  * @param[in] stt The STT handle
1012  *
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  *
1019  * @pre The state should be #STT_STATE_CREATED.
1020  *
1021  * @see stt_set_error_cb()
1022 */
1023 int stt_unset_error_cb(stt_h stt);
1024
1025 /**
1026  * @brief Registers a callback function to detect the default language change.
1027  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1028  * @privlevel public
1029  * @privilege %http://tizen.org/privilege/recorder
1030  *
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
1034  *
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  *
1041  * @pre The state should be #STT_STATE_CREATED.
1042  *
1043  * @see stt_default_language_changed_cb()
1044  * @see stt_unset_default_language_changed_cb()
1045 */
1046 int stt_set_default_language_changed_cb(stt_h stt, stt_default_language_changed_cb callback, void* user_data);
1047
1048 /**
1049  * @brief Unregisters the callback function.
1050  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1051  * @privlevel public
1052  * @privilege %http://tizen.org/privilege/recorder
1053  *
1054  * @param[in] stt The STT handle
1055  *
1056  * @return 0 on success, otherwise a negative error value
1057  * @retval #STT_ERROR_NONE Successful
1058  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
1059  * @retval #STT_ERROR_INVALID_STATE Invalid state
1060  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
1061  *
1062  * @pre The state should be #STT_STATE_CREATED.
1063  *
1064  * @see stt_set_default_language_changed_cb()
1065 */
1066 int stt_unset_default_language_changed_cb(stt_h stt);
1067
1068 #ifdef __cplusplus
1069 }
1070 #endif
1071
1072 /**
1073  * @}@}
1074  */
1075
1076 #endif /* __STT_H__ */
1077