Added set/unset background volume ratio fucntion.
[platform/core/uifw/tts.git] / include / tts_setting.h
1 /*
2 *  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved 
3 *  Licensed under the Apache License, Version 2.0 (the "License");
4 *  you may not use this file except in compliance with the License.
5 *  You may obtain a copy of the License at
6 *  http://www.apache.org/licenses/LICENSE-2.0
7 *  Unless required by applicable law or agreed to in writing, software
8 *  distributed under the License is distributed on an "AS IS" BASIS,
9 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 *  See the License for the specific language governing permissions and
11 *  limitations under the License.
12 */
13
14
15 #ifndef __TTS_SETTING_H__
16 #define __TTS_SETTING_H__
17
18 #include <tizen.h>
19
20 /**
21 * @file tts_setting.h
22 */
23
24 /**
25 * @addtogroup TTS_SETTING_MODULE
26 * @{
27 */
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /** 
34 * @brief Enumerations of error codes.
35 */
36 typedef enum {
37         TTS_SETTING_ERROR_NONE                  = TIZEN_ERROR_NONE,             /**< Success, No error */
38         TTS_SETTING_ERROR_OUT_OF_MEMORY         = TIZEN_ERROR_OUT_OF_MEMORY,    /**< Out of Memory */
39         TTS_SETTING_ERROR_IO_ERROR              = TIZEN_ERROR_IO_ERROR,         /**< I/O error */
40         TTS_SETTING_ERROR_INVALID_PARAMETER     = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
41         TTS_SETTING_ERROR_PERMISSION_DENIED     = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
42         TTS_SETTING_ERROR_NOT_SUPPORTED         = TIZEN_ERROR_NOT_SUPPORTED,    /**< TTS is NOT supported */
43         TTS_SETTING_ERROR_INVALID_STATE         = TIZEN_ERROR_TTS | 0x01,       /**< Invalid state */
44         TTS_SETTING_ERROR_INVALID_VOICE         = TIZEN_ERROR_TTS | 0x02,       /**< Invalid voice */
45         TTS_SETTING_ERROR_ENGINE_NOT_FOUND      = TIZEN_ERROR_TTS | 0x03,       /**< No available TTS-engine  */
46         TTS_SETTING_ERROR_OPERATION_FAILED      = TIZEN_ERROR_TTS | 0x04,       /**< Operation failed  */
47         TTS_SETTING_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_TTS | 0x06        /**< Not supported feature of current engine */
48 } tts_setting_error_e;
49
50 /** 
51 * @brief Definitions for male voice type.
52 */
53 #define TTS_SETTING_VOICE_TYPE_MALE     1
54
55 /** 
56 * @brief Definitions for female voice type.
57 */
58 #define TTS_SETTING_VOICE_TYPE_FEMALE   2
59
60 /** 
61 * @brief Definitions for child voice type.
62 */
63 #define TTS_SETTING_VOICE_TYPE_CHILD    3
64
65 /**
66 * @brief Called to get a engine information.
67 *
68 * @param[in] engine_id Engine id.
69 * @param[in] engine_name Engine name.
70 * @param[in] setting_path Gadget path of engine specific setting.
71 * @param[in] user_data User data passed from the tts_setting_foreach_supported_engines().
72 *
73 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop.
74 * @pre tts_setting_foreach_supported_engines() will invoke this callback. 
75 *
76 * @see tts_setting_foreach_supported_engines()
77 */
78 typedef bool(*tts_setting_supported_engine_cb)(const char* engine_id, const char* engine_name, const char* setting_path, void* user_data);
79
80 /**
81 * @brief Called to get a voice.
82 *
83 * @param[in] engine_id Engine id
84 * @param[in] language A language is specified as an ISO 3166 alpha-2 two letter country-code \n
85 *               followed by ISO 639-1 for the two-letter language code. 
86 *               For example, "ko_KR" for Korean, "en_US" for American English..
87 * @param[in] voice_type Voice type
88 * @param[in] user_data User data passed from the tts_setting_foreach_surpported_voices()
89 *
90 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop.
91 * @pre tts_setting_foreach_surpported_voices() will invoke this callback. 
92 *
93 * @see tts_setting_foreach_surpported_voices()
94 */
95 typedef bool(*tts_setting_supported_voice_cb)(const char* engine_id, const char* language, int voice_type, void* user_data);
96
97 /**
98 * @brief Called when the default engine is changed.
99 *
100 * @param[in] engine_id Engine id
101 * @param[in] user_data The user data passed from the callback registration function
102 *
103 * @pre An application registers this callback using tts_setting_set_engine_changed_cb().
104 *
105 * @see tts_setting_set_engine_changed_cb()
106 * @see tts_setting_unset_engine_changed_cb()
107 */
108 typedef void (*tts_setting_engine_changed_cb)(const char* engine_id, void *user_data);
109
110 /**
111 * @brief Called when the default voice is changed.
112 *
113 * @param[in] language A language
114 * @param[in] voice_type Voice type
115 * @param[in] auto_voice Auto voice
116 * @param[in] user_data The user data passed from the callback registration function
117 *
118 * @pre An application registers this callback using registration function.
119 *
120 * @see tts_setting_set_voice_changed_cb()
121 * @see tts_setting_unset_voice_changed_cb()
122 */
123 typedef void (*tts_setting_voice_changed_cb)(const char* language, int voice_type, bool auto_voice, void *user_data);
124
125 /**
126 * @brief Called when the default speed is changed.
127 *
128 * @param[in] speed Default speed
129 * @param[in] user_data The user data passed from the callback registration function
130 *
131 * @pre An application registers this callback using registration function.
132 *
133 * @see tts_setting_set_speed_changed_cb()
134 * @see tts_setting_unset_speed_changed_cb()
135 */
136 typedef void (*tts_setting_speed_changed_cb)(int speed, void *user_data);
137
138 /**
139 * @brief Called when the default pitch is changed.
140 *
141 * @param[in] pitch Default pitch
142 * @param[in] user_data The user data passed from the callback registration function
143 *
144 * @pre An application registers this callback using registration function.
145 *
146 * @see tts_setting_set_pitch_changed_cb()
147 * @see tts_setting_unset_pitch_changed_cb()
148 */
149 typedef void (*tts_setting_pitch_changed_cb)(int pitch, void *user_data);
150
151 /**
152 * @brief Called when the current background volume ratio is changed.
153 *
154 * @param[in] ratio Current background volume ratio
155 * @param[in] user_data The user data passed from the callback registration function
156 *
157 * @pre An application registers this callback using registration function.
158 *
159 * @see tts_setting_set_background_volume_ratio_changed_cb()
160 * @see tts_setting_unset_background_volume_ratio_changed_cb()
161 */
162 typedef void (*tts_setting_background_volume_ratio_changed_cb)(double ratio, void *user_data);
163
164 /**
165 * @brief Initialize TTS setting.
166 *
167 * @remarks If the function succeeds, @a tts setting must be released with tts_setting_finalize().
168 *
169 * @return 0 on success, otherwise a negative error value.
170 * @retval #TTS_SETTING_ERROR_NONE Success.
171 * @retval #TTS_SETTING_ERROR_INVALID_STATE TTS setting has Already been initialized.
172 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
173 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
174 *
175 * @see tts_setting_finalize()
176 */
177 int tts_setting_initialize();
178
179 /**
180 * @brief finalize TTS setting. 
181 *
182 * @return 0 on success, otherwise a negative error value.
183 * @retval #TTS_SETTING_ERROR_NONE Success.
184 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
185 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
186 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
187 *
188 * @see tts_setting_initialize()
189 */
190 int tts_setting_finalize(void);
191
192 /**
193 * @brief Retrieve supported engine informations using callback function.
194 *
195 * @param[in] callback Callback function
196 * @param[in] user_data User data to be passed to the callback function
197 *
198 * @return 0 on success, otherwise a negative error value.
199 * @retval #TTS_SETTING_ERROR_NONE Success.
200 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
201 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
202 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
203 *
204 * @post This function invokes tts_setting_supported_engine_cb() repeatedly for getting engine information. 
205 *
206 * @see tts_setting_supported_engine_cb()
207 */
208 int tts_setting_foreach_supported_engines(tts_setting_supported_engine_cb callback, void* user_data);
209
210 /**
211 * @brief Get current engine id.
212 *
213 * @remark If the function is success, @a engine_id must be released with free() by you.
214 *
215 * @param[out] engine_id Engine id
216 *
217 * @return 0 on success, otherwise a negative error value.
218 * @retval #TTS_SETTING_ERROR_NONE Success.
219 * @retval #TTS_SETTING_ERROR_OUT_OF_MEMORY Out of memory.
220 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
221 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
222 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
223 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
224 *
225 * @see tts_setting_set_engine()
226 */
227 int tts_setting_get_engine(char** engine_id);
228
229 /**
230 * @brief Set current engine id.
231 *
232 * @param[in] engine_id Engine id
233 *
234 * @return 0 on success, otherwise a negative error value.
235 * @retval #TTS_SETTING_ERROR_NONE Success.
236 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
237 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
238 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
239 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
240 *
241 * @see tts_setting_get_engine()
242 */
243 int tts_setting_set_engine(const char* engine_id);
244
245 /**
246 * @brief Get supported voices of current engine.
247 *
248 * @param[in] callback Callback function
249 * @param[in] user_data User data to be passed to the callback function
250 *
251 * @return 0 on success, otherwise a negative error value.
252 * @retval #TTS_SETTING_ERROR_NONE Success.
253 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
254 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
255 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
256 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
257 *
258 * @post This function invokes tts_setting_supported_voice_cb() repeatedly for getting supported voices. 
259 *
260 * @see tts_setting_supported_voice_cb()
261 */
262 int tts_setting_foreach_supported_voices(tts_setting_supported_voice_cb callback, void* user_data);
263
264 /**
265 * @brief Get a default voice of current engine.
266 *
267 * @remark If the function is success, @a language must be released with free() by you.
268 *
269 * @param[out] language Default language
270 * @param[out] voice_type Default voice type
271 *
272 * @return 0 on success, otherwise a negative error value.
273 * @retval #TTS_SETTING_ERROR_NONE Success.
274 * @retval #TTS_SETTING_ERROR_OUT_OF_MEMORY Out of memory.
275 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
276 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
277 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
278 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
279 *
280 * @see tts_setting_set_voice()
281 */
282 int tts_setting_get_voice(char** language, int* voice_type);
283
284 /**
285 * @brief Set a default voice of current engine.
286 *
287 * @param[in] language Default language
288 * @param[in] voice_type Default voice type
289 *
290 * @return 0 on success, otherwise a negative error value.
291 * @retval #TTS_SETTING_ERROR_NONE Success.
292 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
293 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
294 * @retval #TTS_SETTING_ERROR_INVALID_VOICE Invalid voice.
295 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
296 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
297 *
298 * @see tts_setting_get_voice()
299 */
300 int tts_setting_set_voice(const char* language, int voice_type);
301
302 /**
303 * @brief Get a automatic option of voice.
304 *
305 * @param[out] value Automatic option
306 *
307 * @return 0 on success, otherwise a negative error value.
308 * @retval #TTS_SETTING_ERROR_NONE Success.
309 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
310 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
311 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
312 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
313 *
314 * @see tts_setting_set_auto_voice()
315 */
316 int tts_setting_get_auto_voice(bool* value);
317
318 /**
319 * @brief Set a automatic option of voice.
320 *
321 * @param[in] value Automatic option
322 *
323 * @return 0 on success, otherwise a negative error value.
324 * @retval #TTS_SETTING_ERROR_NONE Success.
325 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
326 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
327 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
328 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
329 *
330 * @see tts_setting_get_auto_voice()
331 */
332 int tts_setting_set_auto_voice(bool value);
333
334 /**
335 * @brief Gets the speed range.
336 *
337 * @param[out] min The minimum speed value
338 * @param[out] normal The normal speed value
339 * @param[out] max The maximum speed value
340 *
341 * @return 0 on success, otherwise a negative error value
342 * @retval #TTS_SETTING_ERROR_NONE Success.
343 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
344 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
345 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
346 *
347 * @see tts_setting_get_speed()
348 * @see tts_setting_set_speed()
349 */
350 int tts_setting_get_speed_range(int* min, int* normal, int* max);
351
352 /**
353 * @brief Get default speed.
354 *
355 * @param[out] speed Default voice speed
356 *
357 * @return 0 on success, otherwise a negative error value.
358 * @retval #TTS_SETTING_ERROR_NONE Success.
359 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
360 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
361 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
362 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
363 *
364 * @see tts_setting_get_speed_range()
365 * @see tts_setting_set_speed()
366 */
367 int tts_setting_get_speed(int* speed);
368
369 /**
370 * @brief Set default speed.
371 *
372 * @param[in] speed Default voice speed
373 *
374 * @return 0 on success, otherwise a negative error value.
375 * @retval #TTS_SETTING_ERROR_NONE Success.
376 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
377 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
378 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
379 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
380 *
381 * @see tts_setting_get_speed_range()
382 * @see tts_setting_get_speed()
383 */
384 int tts_setting_set_speed(int speed);
385
386 /**
387 * @brief Gets the pitch range.
388 *
389 * @param[out] min The minimum pitch value
390 * @param[out] normal The normal pitch value
391 * @param[out] max The maximum pitch value
392 *
393 * @return 0 on success, otherwise a negative error value
394 * @retval #TTS_SETTING_ERROR_NONE Success.
395 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
396 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
397 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
398 *
399 * @see tts_setting_get_pitch()
400 * @see tts_setting_set_pitch()
401 */
402 int tts_setting_get_pitch_range(int* min, int* normal, int* max);
403
404 /**
405 * @brief Set a default pitch.
406 *
407 * @param[out] pitch Default voice pitch
408 *
409 * @return 0 on success, otherwise a negative error value.
410 * @retval #TTS_SETTING_ERROR_NONE Success.
411 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
412 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
413 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
414 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED_FEATURE Not supported feature.
415 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
416 *
417 * @see tts_setting_get_pitch_range()
418 * @see tts_setting_set_pitch()
419 */
420 int tts_setting_get_pitch(int* pitch);
421
422 /**
423 * @brief Set a default pitch.
424 *
425 * @param[in] pitch Default voice pitch
426 *
427 * @return 0 on success, otherwise a negative error value.
428 * @retval #TTS_SETTING_ERROR_NONE Success.
429 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
430 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
431 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
432 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED_FEATURE Not supported feature.
433 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
434 *
435 * @see tts_setting_get_pitch_range()
436 * @see tts_setting_get_pitch()
437 */
438 int tts_setting_set_pitch(int pitch);
439
440 /**
441 * @brief Gets a current background volume ratio.
442 *
443 * @param[out] ratio Current background volume ratio
444 *
445 * @return 0 on success, otherwise a negative error value.
446 * @retval #TTS_SETTING_ERROR_NONE Success.
447 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
448 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
449 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
450 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED_FEATURE Not supported feature.
451 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
452 *
453 * @see tts_setting_set_background_volume_ratio()
454 */
455 int tts_setting_get_background_volume_ratio(double *ratio);
456
457 /**
458 * @brief Sets a current background volume ratio.
459 *
460 * @param[in] ratio Current background volume ratio (Range 0.0 ~ 1.0)
461 *
462 * @return 0 on success, otherwise a negative error value.
463 * @retval #TTS_SETTING_ERROR_NONE Success.
464 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
465 * @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
466 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
467 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED_FEATURE Not supported feature.
468 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
469 *
470 * @see tts_setting_get_background_volume_ratio()
471 */
472 int tts_setting_set_background_volume_ratio(double ratio);
473
474 /**
475 * @brief Registers a callback function to be called when engine information is changed
476 *
477 * @param[in] callback The callback function to register
478 * @param[in] user_data The user data to be passed to the callback function
479 *
480 * @return 0 on success, otherwise a negative error value
481 * @retval #TTS_SETTING_ERROR_NONE Successful
482 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter
483 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
484 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
485 *
486 * @see tts_setting_engine_changed_cb()
487 * @see tts_setting_unset_engine_changed_cb()
488 */
489 int tts_setting_set_engine_changed_cb(tts_setting_engine_changed_cb callback, void* user_data);
490
491 /**
492 * @brief Unregisters the callback function
493 *
494 * @return 0 on success, otherwise a negative error value
495 * @retval #TTS_SETTING_ERROR_NONE Successful
496 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
497 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
498 *
499 * @see tts_setting_set_engine_changed_cb()
500 */
501 int tts_setting_unset_engine_changed_cb();
502
503 /**
504 * @brief Registers a callback function to be called when default voice is changed
505 *
506 * @param[in] callback The callback function to register
507 * @param[in] user_data The user data to be passed to the callback function
508 *
509 * @return 0 on success, otherwise a negative error value
510 * @retval #TTS_SETTING_ERROR_NONE Successful
511 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter
512 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
513 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
514 *
515 * @see tts_setting_voice_changed_cb()
516 * @see tts_setting_unset_voice_changed_cb()
517 */
518 int tts_setting_set_voice_changed_cb(tts_setting_voice_changed_cb callback, void* user_data);
519
520 /**
521 * @brief Unregisters the callback function
522 *
523 * @return 0 on success, otherwise a negative error value
524 * @retval #TTS_SETTING_ERROR_NONE Successful
525 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
526 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
527 *
528 * @see tts_setting_set_voice_changed_cb()
529 */
530 int tts_setting_unset_voice_changed_cb();
531
532 /**
533 * @brief Registers a callback function to be called when default speed is changed
534 *
535 * @param[in] callback The callback function to register
536 * @param[in] user_data The user data to be passed to the callback function
537 *
538 * @return 0 on success, otherwise a negative error value
539 * @retval #TTS_SETTING_ERROR_NONE Successful
540 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter
541 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
542 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
543 *
544 * @see tts_setting_speed_changed_cb()
545 * @see tts_setting_unset_speed_changed_cb()
546 */
547 int tts_setting_set_speed_changed_cb(tts_setting_speed_changed_cb callback, void* user_data);
548
549 /**
550 * @brief Unregisters the callback function
551 *
552 * @return 0 on success, otherwise a negative error value
553 * @retval #TTS_SETTING_ERROR_NONE Successful
554 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
555 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
556 *
557 * @see tts_setting_set_speed_changed_cb()
558 */
559 int tts_setting_unset_speed_changed_cb();
560
561 /**
562 * @brief Registers a callback function to be called when default pitch is changed
563 *
564 * @param[in] callback The callback function to register
565 * @param[in] user_data The user data to be passed to the callback function
566 *
567 * @return 0 on success, otherwise a negative error value
568 * @retval #TTS_SETTING_ERROR_NONE Successful
569 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter
570 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
571 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
572 *
573 * @see tts_setting_pitch_changed_cb()
574 * @see tts_setting_unset_pitch_changed_cb()
575 */
576 int tts_setting_set_pitch_changed_cb(tts_setting_pitch_changed_cb callback, void* user_data);
577
578 /**
579 * @brief Unregisters the callback function
580 *
581 * @return 0 on success, otherwise a negative error value
582 * @retval #TTS_SETTING_ERROR_NONE Successful
583 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
584 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
585 *
586 * @see tts_setting_set_pitch_changed_cb()
587 */
588 int tts_setting_unset_pitch_changed_cb();
589
590
591 /**
592 * @brief Sets a callback function to be called when current background volume is changed
593 *
594 * @param[in] callback The callback function to register
595 * @param[in] user_data The user data to be passed to the callback function
596 *
597 * @return 0 on success, otherwise a negative error value
598 * @retval #TTS_SETTING_ERROR_NONE Successful
599 * @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter
600 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
601 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
602 *
603 * @see tts_setting_background_volume_ratio_changed_cb()
604 * @see tts_setting_unset_background_volume_ratio_changed_cb()
605 */
606 int tts_setting_set_background_volume_ratio_changed_cb(tts_setting_background_volume_ratio_changed_cb callback, void* user_data);
607
608 /**
609 * @brief Unsets the callback function
610 *
611 * @return 0 on success, otherwise a negative error value
612 * @retval #TTS_SETTING_ERROR_NONE Successful
613 * @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
614 * @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
615 *
616 * @see tts_setting_set_background_volume_ratio_changed_cb()
617 */
618 int tts_setting_unset_background_volume_ratio_changed_cb();
619
620 #ifdef __cplusplus
621 }
622 #endif
623
624 /**
625 * @}
626 */
627
628 #endif /* __TTS_SETTING_H__ */