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