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