Fix tizen version description (7.5 -> 8.0)
[platform/core/uifw/tts.git] / include / tts.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
18 #ifndef __TTS_H__
19 #define __TTS_H__
20
21
22 #include <tizen.h>
23
24
25 /**
26 * @file tts.h
27 */
28
29
30 /**
31 * @addtogroup CAPI_UIX_TTS_MODULE
32 * @{
33 */
34
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40
41 /**
42  * @brief Enumeration for error code.
43  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
44 */
45 typedef enum {
46         TTS_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
47         TTS_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of Memory */
48         TTS_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
49         TTS_ERROR_INVALID_PARAMETER     = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
50         TTS_ERROR_OUT_OF_NETWORK = TIZEN_ERROR_NETWORK_DOWN, /**< Network is down */
51         TTS_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< No answer from the daemon */
52         TTS_ERROR_PERMISSION_DENIED     = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
53         TTS_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< TTS NOT supported */
54         TTS_ERROR_INVALID_STATE = TIZEN_ERROR_TTS | 0x01, /**< Invalid state */
55         TTS_ERROR_INVALID_VOICE = TIZEN_ERROR_TTS | 0x02, /**< Invalid voice */
56         TTS_ERROR_ENGINE_NOT_FOUND = TIZEN_ERROR_TTS | 0x03, /**< No available engine */
57         TTS_ERROR_OPERATION_FAILED = TIZEN_ERROR_TTS | 0x04, /**< Operation failed */
58         TTS_ERROR_AUDIO_POLICY_BLOCKED = TIZEN_ERROR_TTS | 0x05, /**< Audio policy blocked */
59         TTS_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_TTS | 0x06, /**< Not supported feature of current engine @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
60         TTS_ERROR_SERVICE_RESET = TIZEN_ERROR_TTS | 0x07, /**< Service reset @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */
61         TTS_ERROR_SCREEN_READER_OFF = TIZEN_ERROR_TTS | 0x08 /**< Screen reader is off (Since 6.5) */
62 } tts_error_e;
63
64
65 /**
66  * @brief Enumeration for TTS mode.
67  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
68 */
69 typedef enum {
70         TTS_MODE_DEFAULT = 0, /**< Default mode for normal application */
71         TTS_MODE_NOTIFICATION = 1, /**< Notification mode */
72         TTS_MODE_SCREEN_READER = 2 /**< Accessibility mode */
73 } tts_mode_e;
74
75
76 /**
77  * @brief Enumeration for state.
78  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
79 */
80 typedef enum {
81         TTS_STATE_CREATED = 0, /**< 'CREATED' state */
82         TTS_STATE_READY = 1, /**< 'READY' state */
83         TTS_STATE_PLAYING = 2, /**< 'PLAYING' state */
84         TTS_STATE_PAUSED = 3 /**< 'PAUSED' state*/
85 } tts_state_e;
86
87
88 /**
89  * @brief Enumeration for service state.
90  * @since_tizen 7.0
91 */
92 typedef enum {
93         TTS_SERVICE_STATE_NONE = -1, /**< 'None' state (Since 8.0) */
94         TTS_SERVICE_STATE_READY = 0, /**< 'Ready' state */
95         TTS_SERVICE_STATE_SYNTHESIZING, /**< 'Synthesizing' state */
96         TTS_SERVICE_STATE_PLAYING, /**< 'Playing' state */
97         TTS_SERVICE_STATE_BLOCKED /**< 'Blocked' state (Since 8.0) */
98 } tts_service_state_e;
99
100
101 /**
102  * @brief Definition for automatic speaking speed.
103  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
104 */
105 #define TTS_SPEED_AUTO          0
106
107
108 /**
109  * @brief Definition for automatic voice type.
110  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
111 */
112 #define TTS_VOICE_TYPE_AUTO     0
113
114
115 /**
116  * @brief Definition for male voice type.
117  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
118 */
119 #define TTS_VOICE_TYPE_MALE     1
120
121
122 /**
123  * @brief Definition for female voice type.
124  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
125 */
126 #define TTS_VOICE_TYPE_FEMALE   2
127
128
129 /**
130  * @brief Definition for child voice type.
131  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
132 */
133 #define TTS_VOICE_TYPE_CHILD    3
134
135
136 /**
137  * @brief The TTS handle.
138  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
139 */
140 typedef struct tts_s *tts_h;
141
142
143 /**
144  * @brief Called when the state of TTS is changed.
145  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
146  * @details If the daemon must stop player because of changing engine and
147  *          the daemon must pause player because of other requests, this callback function is called.
148  * @param[in] tts The TTS handle
149  * @param[in] previous The previous state
150  * @param[in] current The current state
151  * @param[in] user_data The user data passed from the callback registration function
152  * @pre An application registers this callback using tts_set_state_changed_cb() to detect changing state.
153  * @see tts_set_state_changed_cb()
154  * @see tts_unset_state_changed_cb()
155 */
156 typedef void (*tts_state_changed_cb)(tts_h tts, tts_state_e previous, tts_state_e current, void* user_data);
157
158
159 /**
160  * @brief Called when utterance has started.
161  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
162  * @param[in] tts The TTS handle
163  * @param[in] utt_id The utterance ID passed from the add text function
164  * @param[in] user_data The user data passed from the callback registration function
165  * @pre An application registers this callback using tts_set_utterance_started_cb() to detect utterance started.
166  * @see tts_add_text()
167  * @see tts_set_utterance_started_cb()
168  * @see tts_unset_utterance_started_cb()
169 */
170 typedef void (*tts_utterance_started_cb)(tts_h tts, int utt_id, void* user_data);
171
172
173 /**
174  * @brief Called when utterance is finished.
175  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
176  * @param[in] tts The TTS handle
177  * @param[in] utt_id The utterance ID passed from the add text function
178  * @param[in] user_data The user data passed from the callback registration function
179  * @pre An application registers this callback using tts_set_utterance_completed_cb() to detect utterance completed.
180  * @see tts_add_text()
181  * @see tts_set_utterance_completed_cb()
182  * @see tts_unset_utterance_completed_cb()
183 */
184 typedef void (*tts_utterance_completed_cb)(tts_h tts, int utt_id, void *user_data);
185
186
187 /**
188  * @brief Called when an error occurs.
189  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
190  * @param[in] tts The TTS handle
191  * @param[in] utt_id The utterance ID passed from the add text function
192  * @param[in] reason The error code
193  * @param[in] user_data The user data passed from the callback registration function
194  * @pre An application registers this callback using tts_set_error_cb() to detect error.
195  * @see tts_play()
196  * @see tts_pause()
197  * @see tts_stop()
198  * @see tts_set_error_cb()
199  * @see tts_unset_error_cb()
200 */
201 typedef void (*tts_error_cb)(tts_h tts, int utt_id, tts_error_e reason, void* user_data);
202
203
204 /**
205  * @brief Called to retrieve the supported voice.
206  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
207  * @param[in] tts The TTS handle
208  * @param[in] language Language 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)
209  * @param[in] voice_type A voice type (e.g. #TTS_VOICE_TYPE_MALE, #TTS_VOICE_TYPE_FEMALE)
210  * @param[in] user_data The user data passed from the foreach function
211  * @return @c true to continue with the next iteration of the loop,
212  *         @c false to break out of the loop
213  * @pre tts_foreach_supported_voices() will invoke this callback function.
214  * @see tts_foreach_supported_voices()
215 */
216 typedef bool(*tts_supported_voice_cb)(tts_h tts, const char* language, int voice_type, void* user_data);
217
218
219 /**
220  * @brief Called when the default voice is changed.
221  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
222  * @param[in] tts The TTS handle
223  * @param[in] previous_language The previous language
224  * @param[in] previous_voice_type The previous voice type
225  * @param[in] current_language The current language
226  * @param[in] current_voice_type The current voice type
227  * @param[in] user_data The user data passed from the callback registration function
228  * @see tts_set_default_voice_changed_cb()
229 */
230 typedef void (*tts_default_voice_changed_cb)(tts_h tts, const char* previous_language, int previous_voice_type,
231                                 const char* current_language, int current_voice_type, void* user_data);
232
233
234 /**
235  * @brief Called when the engine is changed.
236  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
237  * @param[in] tts The TTS handle
238  * @param[in] engine_id Engine ID
239  * @param[in] language The default language 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)
240  * @param[in] voice_type The default voice type
241  * @param[in] need_credential The necessity of credential
242  * @param[in] user_data The user data passed from the callback registration function
243  * @see tts_set_engine_changed_cb()
244 */
245 typedef void (*tts_engine_changed_cb)(tts_h tts, const char* engine_id, const char* language, int voice_type, bool need_credential, void* user_data);
246
247
248 /**
249  * @brief Called when the option of screen reader is changed.
250  * @since_tizen 6.5
251  * @param[in] tts The TTS handle
252  * @param[in] is_on The status of screen reader. If @a is_on is @c true, screen reader is turned on. If not, it is turned off.
253  * @param[in] user_data The user data passed from the callback registration function
254  * @see tts_set_screen_reader_changed_cb()
255 */
256 typedef void (*tts_screen_reader_changed_cb)(tts_h tts, bool is_on, void* user_data);
257
258
259 /**
260  * @brief Called when the state of TTS service is changed.
261  * @since_tizen 7.0
262  * @remarks The @a tts handle should not be destroyed in the callback.
263  * @param[in] tts The TTS handle, the same handle for which the callback was set.
264  * @param[in] previous The previous state of TTS service
265  * @param[in] current The current state of TTS service
266  * @param[in] user_data The user data passed from the callback registration function
267  * @pre An application registers this callback using tts_set_service_state_changed_cb() to detect changing state of TTS service.
268  * @see tts_set_service_state_changed_cb()
269  * @see tts_unset_service_state_changed_cb()
270 */
271 typedef void (*tts_service_state_changed_cb)(tts_h tts, tts_service_state_e previous, tts_service_state_e current, void* user_data);
272
273
274 /**
275  * @brief Creates a handle for TTS.
276  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
277  * @remarks If the function succeeds, @a tts handle must be released with tts_destroy().
278  * @param[out] tts The TTS handle
279  * @return @c 0 on success,
280  *         otherwise a negative error value
281  * @retval #TTS_ERROR_NONE Successful
282  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
283  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
284  * @retval #TTS_ERROR_OUT_OF_MEMORY Out of memory
285  * @retval #TTS_ERROR_ENGINE_NOT_FOUND Engine not found
286  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
287  * @post If this function is called, the TTS state will be #TTS_STATE_CREATED.
288  * @see tts_destroy()
289 */
290 int tts_create(tts_h* tts);
291
292
293 /**
294  * @brief Destroys the handle and disconnects the daemon.
295  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
296  * @param[in] tts The TTS handle
297  * @return @c 0 on success,
298  *         otherwise a negative error value
299  * @retval #TTS_ERROR_NONE Successful
300  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
301  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
302  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
303  * @see tts_create()
304 */
305 int tts_destroy(tts_h tts);
306
307
308 /**
309  * @brief Sets the TTS mode.
310  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
311  * @param[in] tts The TTS handle
312  * @param[in] mode The mode
313  * @return @c 0 on success,
314  *         otherwise a negative error value
315  * @retval #TTS_ERROR_NONE Successful
316  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
317  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
318  * @retval #TTS_ERROR_INVALID_STATE Invalid state
319  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
320  * @pre The state should be #TTS_STATE_CREATED.
321  * @see tts_get_mode()
322 */
323 int tts_set_mode(tts_h tts, tts_mode_e mode);
324
325
326 /**
327  * @brief Gets the TTS mode.
328  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
329  * @param[in] tts The TTS handle
330  * @param[out] mode The mode
331  * @return @c 0 on success,
332  *         otherwise a negative error value
333  * @retval #TTS_ERROR_NONE Successful
334  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
335  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
336  * @retval #TTS_ERROR_INVALID_STATE Invalid state
337  * @pre The state should be #TTS_STATE_CREATED.
338  * @see tts_set_mode()
339 */
340 int tts_get_mode(tts_h tts, tts_mode_e* mode);
341
342
343 /**
344  * @brief Sets the app credential.
345  * @details Using this API, the application can set a credential.
346  *          The credential is a key to verify the authorization about using the engine.
347  *          If the application sets the credential, it will be able to use functions of the engine entirely.
348  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
349  * @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.
350  *          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.
351  * @param[in] tts The TTS handle
352  * @param[in] credential The app credential
353  * @return @c 0 on success,
354  *         otherwise a negative error value
355  * @retval #TTS_ERROR_NONE Success
356  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
357  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
358  * @retval #TTS_ERROR_INVALID_STATE Invalid state
359  * @pre The state should be #TTS_STATE_CREATED or #TTS_STATE_READY.
360  * @see tts_play()
361 */
362 int tts_set_credential(tts_h tts, const char* credential);
363
364
365 /**
366  * @brief Connects the daemon asynchronously.
367  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
368  * @param[in] tts The TTS handle
369  * @return @c 0 on success,
370  *         otherwise a negative error value
371  * @retval #TTS_ERROR_NONE Successful
372  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
373  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
374  * @retval #TTS_ERROR_INVALID_STATE Invalid state
375  * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
376  * @pre The state should be #TTS_STATE_CREATED.
377  * @post If this function is successful, the TTS state will be #TTS_STATE_READY.
378  *       If this function is failed, the error callback is called. (e.g. #TTS_ERROR_ENGINE_NOT_FOUND)
379  * @see tts_unprepare()
380 */
381 int tts_prepare(tts_h tts);
382
383
384 /**
385  * @brief Disconnects the daemon.
386  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
387  * @param[in] tts The TTS handle
388  * @return @c 0 on success,
389  *         otherwise a negative error value
390  * @retval #TTS_ERROR_NONE Successful
391  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
392  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
393  * @retval #TTS_ERROR_INVALID_STATE Invalid state
394  * @pre The state should be #TTS_STATE_READY.
395  * @post If this function is called, the TTS state will be #TTS_STATE_CREATED.
396  * @see tts_prepare()
397 */
398 int tts_unprepare(tts_h tts);
399
400
401 /**
402  * @brief Connects the daemon synchronously.
403  * @since_tizen 7.0
404  * @param[in] tts The TTS handle
405  * @return @c 0 on success,
406  *         otherwise a negative error value
407  * @retval #TTS_ERROR_NONE Successful
408  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
409  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
410  * @retval #TTS_ERROR_INVALID_STATE Invalid state
411  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
412  * @pre The state should be #TTS_STATE_CREATED.
413  * @post If this function is successful, the TTS state will be #TTS_STATE_READY.
414  * @see tts_unprepare()
415 */
416 int tts_prepare_sync(tts_h tts);
417
418
419 /**
420  * @brief Retrieves all supported voices of the current engine using callback function.
421  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
422  * @param[in] tts The TTS handle
423  * @param[in] callback The callback function to invoke
424  * @param[in] user_data The user data to be passed to the callback function
425  * @return @c 0 on success,
426  *         otherwise a negative error value
427  * @retval #TTS_ERROR_NONE Successful
428  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
429  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
430  * @retval #TTS_ERROR_ENGINE_NOT_FOUND Engine not found
431  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
432  * @post This function invokes tts_supported_voice_cb() repeatedly for getting voices.
433  * @see tts_get_default_voice()
434 */
435 int tts_foreach_supported_voices(tts_h tts, tts_supported_voice_cb callback, void* user_data);
436
437
438 /**
439  * @brief Gets the default voice set by the user.
440  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
441  * @remarks If the function succeeds, @a language must be released with free().
442  * @param[in] tts The TTS handle
443  * @param[out] language Language 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)
444  * @param[out] voice_type The voice type
445  * @return @c 0 on success,
446  *         otherwise a negative error value
447  * @retval #TTS_ERROR_NONE Successful
448  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
449  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
450  * @retval #TTS_ERROR_ENGINE_NOT_FOUND Engine not found
451  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
452  * @see tts_foreach_supported_voices()
453 */
454 int tts_get_default_voice(tts_h tts, char** language, int* voice_type);
455
456
457 /**
458  * @brief Sets the private data to tts engine.
459  * @details The private data is the setting parameter for applying keys provided by the engine.
460  *          Using this API, the application can set the private data and use the corresponding key of the engine.
461  *          For example, if the engine provides 'girl's voice' as a voice type, the application can set the private data as the following.
462  *          int ret = tts_set_private_data(tts_h, "voice_type", "GIRL");
463  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
464  * @remarks If the engine is replaced with the other engine, the key may be ignored.
465  * @param[in] tts The TTS handle
466  * @param[in] key The field name of private data
467  * @param[in] data The data for set
468  * @return @c 0 on success,
469  *         otherwise a negative error value
470  * @retval #TTS_ERROR_NONE Successful
471  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
472  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
473  * @retval #TTS_ERROR_INVALID_STATE Invalid state
474  * @retval #TTS_ERROR_ENGINE_NOT_FOUND Engine not found
475  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
476  * @pre The state should be #TTS_STATE_READY.
477  * @see tts_get_private_data()
478 */
479 int tts_set_private_data(tts_h tts, const char* key, const char* data);
480
481
482 /**
483  * @brief Gets the private data from tts engine.
484  * @details The private data is the information provided by the engine.
485  *          Using this API, the application can get the private data which corresponds to the key from the engine.
486  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
487  * @remarks The @a data must be released using free() when it is no longer required.
488  *          If the engine is replaced with the other engine, the key may be ignored.
489  * @param[in] tts The TTS handle
490  * @param[in] key The field name of private data
491  * @param[out] data The data field of private data
492  * @return @c 0 on success,
493  *         otherwise a negative error value
494  * @retval #TTS_ERROR_NONE Successful
495  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
496  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
497  * @retval #TTS_ERROR_INVALID_STATE Invalid state
498  * @retval #TTS_ERROR_ENGINE_NOT_FOUND Engine not found
499  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
500  * @pre The state should be #TTS_STATE_READY.
501  * @see tts_set_private_data()
502 */
503 int tts_get_private_data(tts_h tts, const char* key, char** data);
504
505
506 /**
507  * @brief Gets the maximum byte size for text.
508  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
509  * @param[in] tts The TTS handle
510  * @param[out] size The maximum byte size for text
511  * @return @c 0 on success,
512  *         otherwise a negative error value
513  * @retval #TTS_ERROR_NONE Successful
514  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
515  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
516  * @retval #TTS_ERROR_INVALID_STATE Invalid state
517  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
518  * @pre The state should be #TTS_STATE_READY.
519  * @see tts_add_text()
520 */
521 int tts_get_max_text_size(tts_h tts, unsigned int* size);
522
523
524 /**
525  * @brief Gets the current state of TTS.
526  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
527  * @param[in] tts The TTS handle
528  * @param[out] state The current state of TTS
529  * @return @c 0 on success,
530  *         otherwise a negative error value
531  * @retval #TTS_ERROR_NONE Successful
532  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
533  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
534  * @see tts_play()
535  * @see tts_stop()
536  * @see tts_pause()
537 */
538 int tts_get_state(tts_h tts, tts_state_e* state);
539
540
541 /**
542  * @brief Gets the speed range.
543  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
544  * @param[in] tts The TTS handle
545  * @param[out] min The minimum speed value
546  * @param[out] normal The normal speed value
547  * @param[out] max The maximum speed value
548  * @return @c 0 on success,
549  *         otherwise a negative error value
550  * @retval #TTS_ERROR_NONE Successful
551  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
552  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
553  * @retval #TTS_ERROR_INVALID_STATE Invalid state
554  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
555  * @pre The state should be #TTS_STATE_CREATED.
556  * @see tts_add_text()
557 */
558 int tts_get_speed_range(tts_h tts, int* min, int* normal, int* max);
559
560
561 /**
562  * @brief Gets the current error message.
563  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
564  * @remarks This function should be called from a tts error callback. Calling in any other context will result in an Operation failed error.
565  *          A successful call will allocate @a err_msg, which must be released by calling free() when it is no longer required.
566  * @param[in] tts The TTS handle
567  * @param[out] err_msg The current error message
568  * @return @c 0 on success,
569  *         otherwise a negative error value
570  * @retval #TTS_ERROR_NONE Successful
571  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
572  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
573  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
574  * @see tts_set_error_cb()
575  * @see tts_unset_error_cb()
576 */
577 int tts_get_error_message(tts_h tts, char** err_msg);
578
579
580 /**
581  * @brief Gets the current state of TTS service.
582  * @since_tizen 7.0
583  * @param[in] tts The TTS handle
584  * @param[out] service_state The current state of TTS service
585  * @return @c 0 on success,
586  *         otherwise a negative error value
587  * @retval #TTS_ERROR_NONE Successful
588  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
589  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
590  * @retval #TTS_ERROR_INVALID_STATE Invalid state
591  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
592  * @pre The TTS state should be one of: #TTS_STATE_READY, #TTS_STATE_PLAYING, #TTS_STATE_PAUSED.
593  * @see tts_play()
594  * @see tts_stop()
595  * @see tts_pause()
596 */
597 int tts_get_service_state(tts_h tts, tts_service_state_e* service_state);
598
599
600 /**
601  * @brief Checks whether screen reader is turned on or not.
602  * @since_tizen 6.5
603  * @remarks If TTS mode is #TTS_MODE_SCREEN_READER, you should call this function to check whether screen reader is turned on or not, before calling 'tts_prepare()'.
604  *          If TTS mode is #TTS_MODE_SCREEN_READER and @a is_on is @c false, all other functions will return #TTS_ERROR_SCREEN_READER_OFF.
605  *          The @a is_on must be released using free() when it is no longer required.
606  * @param[in] tts The TTS handle
607  * @param[out] is_on The current status of screen reader
608  * @return @c 0 on success,
609  *         otherwise a negative error value
610  * @retval #TTS_ERROR_NONE Successful
611  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
612  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
613  * @see tts_set_screen_reader_changed_cb()
614  * @see tts_unset_screen_reader_changed_cb()
615 */
616 int tts_check_screen_reader_on(tts_h tts, bool* is_on);
617
618
619 /**
620  * @brief Adds a text to the queue.
621  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
622  * @remarks Locale(e.g. setlocale()) MUST be set for utf8 text validation check.
623  * @param[in] tts The TTS handle
624  * @param[in] text An input text based utf8
625  * @param[in] language The language selected from the tts_foreach_supported_voices() (e.g. 'NULL'(Automatic), 'en_US')
626  * @param[in] voice_type The voice type selected from the tts_foreach_supported_voices() (e.g. #TTS_VOICE_TYPE_AUTO, #TTS_VOICE_TYPE_FEMALE)
627  * @param[in] speed A speaking speed (e.g. #TTS_SPEED_AUTO or the value from tts_get_speed_range())
628  * @param[out] utt_id The utterance ID passed to the callback function
629  * @return @c 0 on success,
630  *         otherwise a negative error value
631  * @retval #TTS_ERROR_NONE Successful
632  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
633  * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
634  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
635  * @retval #TTS_ERROR_INVALID_STATE Invalid state
636  * @retval #TTS_ERROR_INVALID_VOICE Invalid voice about language, voice type
637  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
638  * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
639  * @pre The state should be #TTS_STATE_READY, #TTS_STATE_PLAYING or #TTS_STATE_PAUSED.
640  * @see tts_get_max_text_size()
641  * @see tts_set_credential()
642 */
643 int tts_add_text(tts_h tts, const char* text, const char* language, int voice_type, int speed, int* utt_id);
644
645
646 /**
647  * @brief Starts synthesizing voice from the text and plays the synthesized audio data.
648  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
649  * @param[in] tts The TTS handle
650  * @return @c 0 on success,
651  *         otherwise a negative error value
652  * @retval #TTS_ERROR_NONE Successful
653  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
654  * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
655  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
656  * @retval #TTS_ERROR_OUT_OF_NETWORK Out of network
657  * @retval #TTS_ERROR_INVALID_STATE Invalid state
658  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
659  * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
660  * @pre The current state should be #TTS_STATE_READY or #TTS_STATE_PAUSED.
661  * @post If this function succeeds, the TTS state will be #TTS_STATE_PLAYING.
662  * @see tts_add_text()
663  * @see tts_pause()
664  * @see tts_stop()
665  * @see tts_utterance_started_cb()
666  * @see tts_utterance_completed_cb()
667  * @see tts_error_cb()
668  * @see tts_set_credential()
669 */
670 int tts_play(tts_h tts);
671
672
673 /**
674  * @brief Stops playing the utterance and clears the queue.
675  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
676  * @param[in] tts The TTS handle
677  * @return @c 0 on success,
678  *         otherwise a negative error value
679  * @retval #TTS_ERROR_NONE Successful
680  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
681  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
682  * @retval #TTS_ERROR_INVALID_STATE Invalid state
683  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
684  * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
685  * @pre The TTS state should be #TTS_STATE_READY or #TTS_STATE_PLAYING or #TTS_STATE_PAUSED.
686  * @post If this function succeeds, the TTS state will be #TTS_STATE_READY.
687  *       This function will remove all text via tts_add_text() and synthesized sound data.
688  * @see tts_play()
689  * @see tts_pause()
690 */
691 int tts_stop(tts_h tts);
692
693
694 /**
695  * @brief Pauses the currently playing utterance.
696  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
697  * @param[in] tts The TTS handle
698  * @return @c 0 on success,
699  *         otherwise a negative error value
700  * @retval #TTS_ERROR_NONE Successful
701  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
702  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
703  * @retval #TTS_ERROR_INVALID_STATE Invalid state
704  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
705  * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
706  * @pre The TTS state should be #TTS_STATE_PLAYING.
707  * @post If this function succeeds, the TTS state will be #TTS_STATE_PAUSED.
708  * @see tts_play()
709  * @see tts_stop()
710  * @see tts_error_cb()
711 */
712 int tts_pause(tts_h tts);
713
714 /**
715  * @brief Repeats the last added text.
716  * @since_tizen 5.0
717  * @remarks This function repeats the last added text once again.
718  *          If there is no previously added text, this function will not work.
719  *          If the language is changed, the last added text is removed from the service.
720  *          Before calling this function, please call 'tts_stop()' in order to stop playing the previous one.
721  *          If this function succeeds, @a text_repeat must be released with free().
722  * @param[in] tts The TTS handle
723  * @param[out] text_repeat Texts to be played repeatedly
724  * @param[out] utt_id The utterance ID passed to the callback function
725  *
726  * @return @c 0 on success,
727  *         otherwise a negative error value
728  * @retval #TTS_ERROR_NONE Successful
729  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
730  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
731  * @retval #TTS_ERROR_INVALID_STATE Invalid state
732  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
733  * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
734  * @pre The state should be #TTS_STATE_READY.
735  * @post If this function succeeds, the TTS state will be #TTS_STATE_PLAYING.
736  * @see tts_add_text()
737  * @see tts_stop()
738  */
739 int tts_repeat(tts_h tts, char** text_repeat, int* utt_id);
740
741 /**
742  * @brief Registers a callback function to be called when the TTS state changes.
743  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
744  * @param[in] tts The TTS handle
745  * @param[in] callback The callback function to register
746  * @param[in] user_data The user data to be passed to the callback function
747  * @return @c 0 on success,
748  *         otherwise a negative error value
749  * @retval #TTS_ERROR_NONE Successful
750  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
751  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
752  * @retval #TTS_ERROR_INVALID_STATE Invalid state
753  * @pre The state should be #TTS_STATE_CREATED.
754  * @see tts_state_changed_cb()
755  * @see tts_unset_state_changed_cb()
756 */
757 int tts_set_state_changed_cb(tts_h tts, tts_state_changed_cb callback, void* user_data);
758
759
760 /**
761  * @brief Unregisters the callback function.
762  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
763  * @param[in] tts The TTS handle
764  * @return @c 0 on success,
765  *         otherwise a negative error value
766  * @retval #TTS_ERROR_NONE Successful
767  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
768  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
769  * @retval #TTS_ERROR_INVALID_STATE Invalid state
770  * @pre The state should be #TTS_STATE_CREATED.
771  * @see tts_set_state_changed_cb()
772 */
773 int tts_unset_state_changed_cb(tts_h tts);
774
775
776 /**
777  * @brief Registers a callback function to detect utterance start.
778  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
779  * @param[in] tts The TTS handle
780  * @param[in] callback The callback function to register
781  * @param[in] user_data The user data to be passed to the callback function
782  * @return @c 0 on success,
783  *         otherwise a negative error value
784  * @retval #TTS_ERROR_NONE Successful
785  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
786  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
787  * @retval #TTS_ERROR_INVALID_STATE Invalid state
788  * @pre The state should be #TTS_STATE_CREATED.
789  * @see tts_utterance_started_cb()
790  * @see tts_unset_utterance_started_cb()
791 */
792 int tts_set_utterance_started_cb(tts_h tts, tts_utterance_started_cb callback, void* user_data);
793
794
795 /**
796  * @brief Unregisters the callback function.
797  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
798  * @param[in] tts The TTS handle
799  * @return @c 0 on success,
800  *         otherwise a negative error value
801  * @retval #TTS_ERROR_NONE Successful
802  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
803  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
804  * @retval #TTS_ERROR_INVALID_STATE Invalid state
805  * @pre The state should be #TTS_STATE_CREATED.
806  * @see tts_set_utterance_started_cb()
807 */
808 int tts_unset_utterance_started_cb(tts_h tts);
809
810
811 /**
812  * @brief Registers a callback function to detect utterance completion.
813  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
814  * @param[in] tts The TTS handle
815  * @param[in] callback The callback function to register
816  * @param[in] user_data The user data to be passed to the callback function
817  * @return @c 0 on success,
818  *         otherwise a negative error value
819  * @retval #TTS_ERROR_NONE Successful
820  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
821  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
822  * @retval #TTS_ERROR_INVALID_STATE Invalid state
823  * @pre The state should be #TTS_STATE_CREATED.
824  * @see tts_utterance_completed_cb()
825  * @see tts_unset_utterance_completed_cb()
826 */
827 int tts_set_utterance_completed_cb(tts_h tts, tts_utterance_completed_cb callback, void* user_data);
828
829
830 /**
831  * @brief Unregisters the callback function.
832  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
833  * @param[in] tts The TTS handle
834  * @return @c 0 on success,
835  *         otherwise a negative error value
836  * @retval #TTS_ERROR_NONE Successful
837  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
838  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
839  * @retval #TTS_ERROR_INVALID_STATE Invalid state
840  * @pre The state should be #TTS_STATE_CREATED.
841  * @see tts_set_utterance_completed_cb()
842 */
843 int tts_unset_utterance_completed_cb(tts_h tts);
844
845
846 /**
847  * @brief Registers a callback function to detect errors.
848  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
849  * @param[in] tts The TTS handle
850  * @param[in] callback The callback function to register
851  * @param[in] user_data The user data to be passed to the callback function
852  * @return @c 0 on success,
853  *         otherwise a negative error value
854  * @retval #TTS_ERROR_NONE Successful
855  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
856  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
857  * @retval #TTS_ERROR_INVALID_STATE Invalid state
858  * @pre The state should be #TTS_STATE_CREATED.
859  * @see tts_error_cb()
860  * @see tts_unset_error_cb()
861 */
862 int tts_set_error_cb(tts_h tts, tts_error_cb callback, void* user_data);
863
864
865 /**
866  * @brief Unregisters the callback function.
867  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
868  * @param[in] tts The TTS handle
869  * @return @c 0 on success,
870  *         otherwise a negative error value
871  * @retval #TTS_ERROR_NONE Successful
872  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
873  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
874  * @retval #TTS_ERROR_INVALID_STATE Invalid state
875  * @pre The state should be #TTS_STATE_CREATED.
876  * @see tts_set_error_cb()
877 */
878 int tts_unset_error_cb(tts_h tts);
879
880
881 /**
882  * @brief Registers a callback function to detect default voice change.
883  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
884  * @param[in] tts The TTS handle
885  * @param[in] callback The callback function to register
886  * @param[in] user_data The user data to be passed to the callback function
887  * @return @c 0 on success,
888  *         otherwise a negative error value
889  * @retval #TTS_ERROR_NONE Successful
890  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
891  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
892  * @retval #TTS_ERROR_INVALID_STATE Invalid state
893  * @pre The state should be #TTS_STATE_CREATED.
894  * @see tts_default_voice_changed_cb()
895  * @see tts_unset_default_voice_changed_cb()
896 */
897 int tts_set_default_voice_changed_cb(tts_h tts, tts_default_voice_changed_cb callback, void* user_data);
898
899
900 /**
901  * @brief Unregisters the callback function.
902  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
903  * @param[in] tts The TTS handle
904  * @return @c 0 on success,
905  *         otherwise a negative error value
906  * @retval #TTS_ERROR_NONE Successful
907  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
908  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
909  * @retval #TTS_ERROR_INVALID_STATE Invalid state
910  * @pre The state should be #TTS_STATE_CREATED.
911  * @see tts_set_default_voice_changed_cb()
912 */
913 int tts_unset_default_voice_changed_cb(tts_h tts);
914
915
916  /**
917  * @brief Registers a callback function to detect the engine change.
918  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
919  * @param[in] tts The TTS handle
920  * @param[in] callback The callback function to register
921  * @param[in] user_data The user data to be passed to the callback function
922  * @return @c 0 on success,
923  *         otherwise a negative error value
924  * @retval #TTS_ERROR_NONE Successful
925  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
926  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
927  * @retval #TTS_ERROR_INVALID_STATE Invalid state
928  * @pre The state should be #TTS_STATE_CREATED.
929  * @see tts_engine_changed_cb()
930  * @see tts_unset_engine_changed_cb()
931 */
932 int tts_set_engine_changed_cb(tts_h tts, tts_engine_changed_cb callback, void* user_data);
933
934
935 /**
936  * @brief Unregisters the callback function.
937  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
938  * @param[in] tts The TTS handle
939  * @return @c 0 on success,
940  *         otherwise a negative error value
941  * @retval #TTS_ERROR_NONE Successful
942  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
943  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
944  * @retval #TTS_ERROR_INVALID_STATE Invalid state
945  * @pre The state should be #TTS_STATE_CREATED.
946  * @see tts_set_engine_changed_cb()
947 */
948 int tts_unset_engine_changed_cb(tts_h tts);
949
950
951 /**
952  * @brief Registers a callback function to detect the option of screen reader is changed or not.
953  * @since_tizen 6.5
954  * @remarks If TTS mode is #TTS_MODE_SCREEN_READER, you should set the callback to check the option of screen reader is changed or not.
955  * @param[in] tts The TTS handle
956  * @param[in] callback The callback function to register
957  * @param[in] user_data The user data to be passed to the callback function
958  * @return @c 0 on success,
959  *         otherwise a negative error value
960  * @retval #TTS_ERROR_NONE Successful
961  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
962  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
963  * @retval #TTS_ERROR_INVALID_STATE Invalid state
964  * @pre The state should be #TTS_STATE_CREATED.
965  * @see tts_screen_reader_changed_cb()
966  * @see tts_unset_screen_reader_changed_cb()
967 */
968 int tts_set_screen_reader_changed_cb(tts_h tts, tts_screen_reader_changed_cb callback, void* user_data);
969
970
971 /**
972  * @brief Unregisters the callback function to detect the option of screen reader is changed or not.
973  * @since_tizen 6.5
974  * @param[in] tts The TTS handle
975  * @return @c 0 on success,
976  *         otherwise a negative error value
977  * @retval #TTS_ERROR_NONE Successful
978  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
979  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
980  * @retval #TTS_ERROR_INVALID_STATE Invalid state
981  * @pre The state should be #TTS_STATE_CREATED.
982  * @see tts_set_screen_reader_changed_cb()
983 */
984 int tts_unset_screen_reader_changed_cb(tts_h tts);
985
986 /**
987  * @brief Sets a callback function to be called when the TTS service state changes.
988  * @since_tizen 7.0
989  * @param[in] tts The TTS 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
992  * @return @c 0 on success,
993  *         otherwise a negative error value
994  * @retval #TTS_ERROR_NONE Successful
995  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
996  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
997  * @retval #TTS_ERROR_INVALID_STATE Invalid state
998  * @pre The TTS state should be #TTS_STATE_CREATED.
999  * @see tts_service_state_changed_cb()
1000  * @see tts_unset_service_state_changed_cb()
1001 */
1002 int tts_set_service_state_changed_cb(tts_h tts, tts_service_state_changed_cb callback, void* user_data);
1003
1004 /**
1005  * @brief Unsets the callback function.
1006  * @since_tizen 7.0
1007  * @param[in] tts The TTS handle
1008  * @return @c 0 on success,
1009  *         otherwise a negative error value
1010  * @retval #TTS_ERROR_NONE Successful
1011  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1012  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1013  * @retval #TTS_ERROR_INVALID_STATE Invalid state
1014  * @pre The TTS state should be #TTS_STATE_CREATED.
1015  * @see tts_set_service_state_changed_cb()
1016 */
1017 int tts_unset_service_state_changed_cb(tts_h tts);
1018
1019 #ifdef __cplusplus
1020 }
1021 #endif
1022
1023
1024 /**
1025  * @}
1026  */
1027
1028
1029 #endif  /* __TTS_H__ */