2 * Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
31 * @addtogroup CAPI_UIX_TTS_MODULE
42 * @brief Enumeration for error code.
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 (Since 3.0) */
60 TTS_ERROR_SERVICE_RESET = TIZEN_ERROR_TTS | 0x07, /**< Service reset (Since 3.0) */
61 TTS_ERROR_SCREEN_READER_OFF = TIZEN_ERROR_TTS | 0x08 /**< Screen reader is off (Since 6.5) */
66 * @brief Enumeration for TTS mode.
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 */
77 * @brief Enumeration for state.
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*/
89 * @brief Enumeration for service state.
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;
102 * @brief Enumeration for playing mode of TTS.
106 TTS_PLAYING_MODE_BY_SERVICE = 0, /**< Mode for TTS playing on TTS service */
107 TTS_PLAYING_MODE_BY_CLIENT = 1, /**< Mode for TTS playing on TTS client */
108 } tts_playing_mode_e;
112 * @brief Enumeration for audio type.
116 TTS_AUDIO_TYPE_RAW_S16 = 0, /**< Signed 16-bit audio type */
117 TTS_AUDIO_TYPE_RAW_U8 /**< Unsigned 8-bit audio type */
122 * @brief Enumeration for synthesized pcm event.
126 TTS_SYNTHESIZED_PCM_EVENT_FAIL = -1, /**< Event when the synthesized PCM is failed */
127 TTS_SYNTHESIZED_PCM_EVENT_START = 1, /**< Event when the synthesized PCM is received at first */
128 TTS_SYNTHESIZED_PCM_EVENT_CONTINUE = 2, /**< Event when the synthesized PCM is received, not first and not last */
129 TTS_SYNTHESIZED_PCM_EVENT_FINISH = 3 /**< Event when the synthesized PCM is received finally */
130 } tts_synthesized_pcm_event_e;
134 * @brief Definition for automatic speaking speed.
137 #define TTS_SPEED_AUTO 0
141 * @brief Definition for automatic speaking pitch.
144 #define TTS_PITCH_AUTO 0
148 * @brief Definition for automatic speaking volume.
151 #define TTS_VOLUME_AUTO 0
155 * @brief Definition for automatic voice type.
158 #define TTS_VOICE_TYPE_AUTO 0
162 * @brief Definition for male voice type.
165 #define TTS_VOICE_TYPE_MALE 1
169 * @brief Definition for female voice type.
172 #define TTS_VOICE_TYPE_FEMALE 2
176 * @brief Definition for child voice type.
179 #define TTS_VOICE_TYPE_CHILD 3
183 * @brief Definition for personal voice type.
186 #define TTS_VOICE_TYPE_PERSONAL 4
190 * @brief The TTS handle.
193 typedef struct tts_s *tts_h;
197 * @brief The TTS synthesis parameter handle.
200 typedef struct tts_synthesis_parameter_s *tts_synthesis_parameter_h;
204 * @brief Called when the state of TTS is changed.
205 * @details If the daemon must stop player because of changing engine and
206 * the daemon must pause player because of other requests, this callback function is called.
208 * @param[in] tts The TTS handle
209 * @param[in] previous The previous state
210 * @param[in] current The current state
211 * @param[in] user_data The user data passed from the callback registration function
212 * @pre An application registers this callback using tts_set_state_changed_cb() to detect changing state.
213 * @see tts_set_state_changed_cb()
214 * @see tts_unset_state_changed_cb()
216 typedef void (*tts_state_changed_cb)(tts_h tts, tts_state_e previous, tts_state_e current, void* user_data);
220 * @brief Called when utterance has started.
222 * @param[in] tts The TTS handle
223 * @param[in] utt_id The utterance ID passed from the add text function
224 * @param[in] user_data The user data passed from the callback registration function
225 * @pre An application registers this callback using tts_set_utterance_started_cb() to detect utterance started.
226 * @see tts_add_text()
227 * @see tts_set_utterance_started_cb()
228 * @see tts_unset_utterance_started_cb()
230 typedef void (*tts_utterance_started_cb)(tts_h tts, int utt_id, void* user_data);
234 * @brief Called when utterance is finished.
236 * @param[in] tts The TTS handle
237 * @param[in] utt_id The utterance ID passed from the add text function
238 * @param[in] user_data The user data passed from the callback registration function
239 * @pre An application registers this callback using tts_set_utterance_completed_cb() to detect utterance completed.
240 * @see tts_add_text()
241 * @see tts_set_utterance_completed_cb()
242 * @see tts_unset_utterance_completed_cb()
244 typedef void (*tts_utterance_completed_cb)(tts_h tts, int utt_id, void *user_data);
248 * @brief Called when an error occurs.
250 * @param[in] tts The TTS handle
251 * @param[in] utt_id The utterance ID passed from the add text function
252 * @param[in] reason The error code
253 * @param[in] user_data The user data passed from the callback registration function
254 * @pre An application registers this callback using tts_set_error_cb() to detect error.
258 * @see tts_set_error_cb()
259 * @see tts_unset_error_cb()
261 typedef void (*tts_error_cb)(tts_h tts, int utt_id, tts_error_e reason, void* user_data);
265 * @brief Called to retrieve the supported voice.
267 * @param[in] tts The TTS handle
268 * @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)
269 * @param[in] voice_type A voice type (e.g. #TTS_VOICE_TYPE_MALE, #TTS_VOICE_TYPE_FEMALE)
270 * @param[in] user_data The user data passed from the foreach function
271 * @return @c true to continue with the next iteration of the loop,
272 * @c false to break out of the loop
273 * @pre tts_foreach_supported_voices() will invoke this callback function.
274 * @see tts_foreach_supported_voices()
276 typedef bool(*tts_supported_voice_cb)(tts_h tts, const char* language, int voice_type, void* user_data);
280 * @brief Called when the default voice is changed.
282 * @param[in] tts The TTS handle
283 * @param[in] previous_language The previous language
284 * @param[in] previous_voice_type The previous voice type
285 * @param[in] current_language The current language
286 * @param[in] current_voice_type The current voice type
287 * @param[in] user_data The user data passed from the callback registration function
288 * @see tts_set_default_voice_changed_cb()
290 typedef void (*tts_default_voice_changed_cb)(tts_h tts, const char* previous_language, int previous_voice_type,
291 const char* current_language, int current_voice_type, void* user_data);
295 * @brief Called when the engine is changed.
297 * @param[in] tts The TTS handle
298 * @param[in] engine_id Engine ID
299 * @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)
300 * @param[in] voice_type The default voice type
301 * @param[in] need_credential The necessity of credential
302 * @param[in] user_data The user data passed from the callback registration function
303 * @see tts_set_engine_changed_cb()
305 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);
309 * @brief Called when the option of screen reader is changed.
311 * @param[in] tts The TTS handle
312 * @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.
313 * @param[in] user_data The user data passed from the callback registration function
314 * @see tts_set_screen_reader_changed_cb()
316 typedef void (*tts_screen_reader_changed_cb)(tts_h tts, bool is_on, void* user_data);
320 * @brief Called when the state of TTS service is changed.
322 * @remarks The @a tts handle should not be destroyed in the callback.
323 * @param[in] tts The TTS handle, the same handle for which the callback was set.
324 * @param[in] previous The previous state of TTS service
325 * @param[in] current The current state of TTS service
326 * @param[in] user_data The user data passed from the callback registration function
327 * @pre An application registers this callback using tts_set_service_state_changed_cb() to detect changing state of TTS service.
328 * @see tts_set_service_state_changed_cb()
329 * @see tts_unset_service_state_changed_cb()
331 typedef void (*tts_service_state_changed_cb)(tts_h tts, tts_service_state_e previous, tts_service_state_e current, void* user_data);
335 * @brief Called when the synthesized pcm data is come from the engine.
337 * @remarks The @a tts handle should not be destroyed in the callback.
338 * @param[in] tts The TTS handle, the same handle for which the callback was set.
339 * @param[in] utt_id The utterance ID
340 * @param[in] event The event type
341 * @param[in] pcm_data The synthesized pcm data. The @a pcm_data can be used only in the callback. To use outside, make a copy.
342 * @param[in] pcm_data_size The size of the pcm data
343 * @param[in] audio_type The audio type of pcm data
344 * @param[in] sample_rate The sampling rate of pcm data
345 * @param[in] user_data The user data passed from the callback registration function
346 * @pre An application registers this callback using tts_set_synthesized_pcm_cb() to get pcm data.
347 * @see tts_set_synthesized_pcm_cb()
348 * @see tts_unset_synthesized_pcm_cb()
350 typedef void (*tts_synthesized_pcm_cb)(tts_h tts, int utt_id, tts_synthesized_pcm_event_e event, const char* pcm_data, int pcm_data_size, tts_audio_type_e audio_type, int sample_rate, void *user_data);
354 * @brief Creates a handle for TTS.
356 * @remarks If the function succeeds, @a tts handle must be released with tts_destroy().
357 * @param[out] tts The TTS handle
358 * @return @c 0 on success,
359 * otherwise a negative error value
360 * @retval #TTS_ERROR_NONE Successful
361 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
362 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
363 * @retval #TTS_ERROR_OUT_OF_MEMORY Out of memory
364 * @retval #TTS_ERROR_ENGINE_NOT_FOUND Engine not found
365 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
366 * @post If this function is called, the TTS state will be #TTS_STATE_CREATED.
369 int tts_create(tts_h* tts);
373 * @brief Destroys the handle and disconnects the daemon.
375 * @param[in] tts The TTS handle
376 * @return @c 0 on success,
377 * otherwise a negative error value
378 * @retval #TTS_ERROR_NONE Successful
379 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
380 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
381 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
384 int tts_destroy(tts_h tts);
388 * @brief Sets the TTS mode.
390 * @param[in] tts The TTS handle
391 * @param[in] mode The mode
392 * @return @c 0 on success,
393 * otherwise a negative error value
394 * @retval #TTS_ERROR_NONE Successful
395 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
396 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
397 * @retval #TTS_ERROR_INVALID_STATE Invalid state
398 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
399 * @pre The state should be #TTS_STATE_CREATED.
400 * @see tts_get_mode()
402 int tts_set_mode(tts_h tts, tts_mode_e mode);
406 * @brief Gets the TTS mode.
408 * @param[in] tts The TTS handle
409 * @param[out] mode The mode
410 * @return @c 0 on success,
411 * otherwise a negative error value
412 * @retval #TTS_ERROR_NONE Successful
413 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
414 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
415 * @retval #TTS_ERROR_INVALID_STATE Invalid state
416 * @pre The state should be #TTS_STATE_CREATED.
417 * @see tts_set_mode()
419 int tts_get_mode(tts_h tts, tts_mode_e* mode);
423 * @brief Sets the app credential.
424 * @details Using this API, the application can set a credential.
425 * The credential is a key to verify the authorization about using the engine.
426 * If the application sets the credential, it will be able to use functions of the engine entirely.
428 * @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.
429 * 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.
430 * @param[in] tts The TTS handle
431 * @param[in] credential The app credential
432 * @return @c 0 on success,
433 * otherwise a negative error value
434 * @retval #TTS_ERROR_NONE Success
435 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
436 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
437 * @retval #TTS_ERROR_INVALID_STATE Invalid state
438 * @pre The state should be #TTS_STATE_CREATED or #TTS_STATE_READY.
441 int tts_set_credential(tts_h tts, const char* credential);
445 * @brief Connects the daemon asynchronously.
447 * @param[in] tts The TTS handle
448 * @return @c 0 on success,
449 * otherwise a negative error value
450 * @retval #TTS_ERROR_NONE Successful
451 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
452 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
453 * @retval #TTS_ERROR_INVALID_STATE Invalid state
454 * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
455 * @pre The state should be #TTS_STATE_CREATED.
456 * @post If this function is successful, the TTS state will be #TTS_STATE_READY.
457 * If this function is failed, the error callback is called. (e.g. #TTS_ERROR_ENGINE_NOT_FOUND)
458 * @see tts_unprepare()
460 int tts_prepare(tts_h tts);
464 * @brief Disconnects the daemon.
466 * @param[in] tts The TTS handle
467 * @return @c 0 on success,
468 * otherwise a negative error value
469 * @retval #TTS_ERROR_NONE Successful
470 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
471 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
472 * @retval #TTS_ERROR_INVALID_STATE Invalid state
473 * @pre The state should be #TTS_STATE_READY.
474 * @post If this function is called, the TTS state will be #TTS_STATE_CREATED.
477 int tts_unprepare(tts_h tts);
481 * @brief Connects the daemon synchronously.
483 * @param[in] tts The TTS handle
484 * @return @c 0 on success,
485 * otherwise a negative error value
486 * @retval #TTS_ERROR_NONE Successful
487 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
488 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
489 * @retval #TTS_ERROR_INVALID_STATE Invalid state
490 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
491 * @pre The state should be #TTS_STATE_CREATED.
492 * @post If this function is successful, the TTS state will be #TTS_STATE_READY.
493 * @see tts_unprepare()
495 int tts_prepare_sync(tts_h tts);
499 * @brief Retrieves all supported voices of the current engine using callback function.
501 * @param[in] tts The TTS handle
502 * @param[in] callback The callback function to invoke
503 * @param[in] user_data The user data to be passed to the callback function
504 * @return @c 0 on success,
505 * otherwise a negative error value
506 * @retval #TTS_ERROR_NONE Successful
507 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
508 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
509 * @retval #TTS_ERROR_ENGINE_NOT_FOUND Engine not found
510 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
511 * @post This function invokes tts_supported_voice_cb() repeatedly for getting voices.
512 * @see tts_get_default_voice()
514 int tts_foreach_supported_voices(tts_h tts, tts_supported_voice_cb callback, void* user_data);
518 * @brief Gets the default voice set by the user.
520 * @remarks If the function succeeds, @a language must be released with free().
521 * @param[in] tts The TTS handle
522 * @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)
523 * @param[out] voice_type The voice type
524 * @return @c 0 on success,
525 * otherwise a negative error value
526 * @retval #TTS_ERROR_NONE Successful
527 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
528 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
529 * @retval #TTS_ERROR_ENGINE_NOT_FOUND Engine not found
530 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
531 * @see tts_foreach_supported_voices()
533 int tts_get_default_voice(tts_h tts, char** language, int* voice_type);
537 * @brief Sets the private data to tts engine.
538 * @details The private data is the setting parameter for applying keys provided by the engine.
539 * Using this API, the application can set the private data and use the corresponding key of the engine.
540 * For example, if the engine provides 'girl's voice' as a voice type, the application can set the private data as the following.
541 * int ret = tts_set_private_data(#tts_h, "voice_type", "GIRL");
543 * @remarks If the engine is replaced with the other engine, the key may be ignored.
544 * @param[in] tts The TTS handle
545 * @param[in] key The field name of private data
546 * @param[in] data The data for set
547 * @return @c 0 on success,
548 * otherwise a negative error value
549 * @retval #TTS_ERROR_NONE Successful
550 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
551 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
552 * @retval #TTS_ERROR_INVALID_STATE Invalid state
553 * @retval #TTS_ERROR_ENGINE_NOT_FOUND Engine not found
554 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
555 * @pre The state should be #TTS_STATE_READY.
556 * @see tts_get_private_data()
558 int tts_set_private_data(tts_h tts, const char* key, const char* data);
562 * @brief Gets the private data from tts engine.
563 * @details The private data is the information provided by the engine.
564 * Using this API, the application can get the private data which corresponds to the key from the engine.
566 * @remarks The @a data must be released using free() when it is no longer required.
567 * If the engine is replaced with the other engine, the key may be ignored.
568 * @param[in] tts The TTS handle
569 * @param[in] key The field name of private data
570 * @param[out] data The data field of private data
571 * @return @c 0 on success,
572 * otherwise a negative error value
573 * @retval #TTS_ERROR_NONE Successful
574 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
575 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
576 * @retval #TTS_ERROR_INVALID_STATE Invalid state
577 * @retval #TTS_ERROR_ENGINE_NOT_FOUND Engine not found
578 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
579 * @pre The state should be #TTS_STATE_READY.
580 * @see tts_set_private_data()
582 int tts_get_private_data(tts_h tts, const char* key, char** data);
586 * @brief Gets the maximum byte size for text.
588 * @param[in] tts The TTS handle
589 * @param[out] size The maximum byte size for text
590 * @return @c 0 on success,
591 * otherwise a negative error value
592 * @retval #TTS_ERROR_NONE Successful
593 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
594 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
595 * @retval #TTS_ERROR_INVALID_STATE Invalid state
596 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
597 * @pre The state should be #TTS_STATE_READY.
598 * @see tts_add_text()
600 int tts_get_max_text_size(tts_h tts, unsigned int* size);
604 * @brief Gets the current state of TTS.
606 * @param[in] tts The TTS handle
607 * @param[out] state The current state of TTS
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
617 int tts_get_state(tts_h tts, tts_state_e* state);
621 * @brief Gets the speed range.
623 * @param[in] tts The TTS handle
624 * @param[out] min The minimum speed value
625 * @param[out] normal The normal speed value
626 * @param[out] max The maximum speed value
627 * @return @c 0 on success,
628 * otherwise a negative error value
629 * @retval #TTS_ERROR_NONE Successful
630 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
631 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
632 * @retval #TTS_ERROR_INVALID_STATE Invalid state
633 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
634 * @pre The state should be #TTS_STATE_CREATED.
635 * @see tts_add_text()
637 int tts_get_speed_range(tts_h tts, int* min, int* normal, int* max);
641 * @brief Gets the current error message.
643 * @remarks This function should be called from a tts error callback. Calling in any other context will result in an Operation failed error.
644 * A successful call will allocate @a err_msg, which must be released by calling free() when it is no longer required.
645 * @param[in] tts The TTS handle
646 * @param[out] err_msg The current error message
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_INVALID_PARAMETER Invalid parameter
652 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
653 * @see tts_set_error_cb()
654 * @see tts_unset_error_cb()
656 int tts_get_error_message(tts_h tts, char** err_msg);
660 * @brief Gets the current state of TTS service.
662 * @param[in] tts The TTS handle
663 * @param[out] service_state The current state of TTS service
664 * @return @c 0 on success,
665 * otherwise a negative error value
666 * @retval #TTS_ERROR_NONE Successful
667 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
668 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
669 * @retval #TTS_ERROR_INVALID_STATE Invalid state
670 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
671 * @pre The TTS state should be one of: #TTS_STATE_READY, #TTS_STATE_PLAYING, #TTS_STATE_PAUSED.
676 int tts_get_service_state(tts_h tts, tts_service_state_e* service_state);
680 * @brief Checks whether screen reader is turned on or not.
682 * @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()'.
683 * 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.
684 * The @a is_on must be released using free() when it is no longer required.
685 * @param[in] tts The TTS handle
686 * @param[out] is_on The current status of screen reader
687 * @return @c 0 on success,
688 * otherwise a negative error value
689 * @retval #TTS_ERROR_NONE Successful
690 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
691 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
692 * @see tts_set_screen_reader_changed_cb()
693 * @see tts_unset_screen_reader_changed_cb()
695 int tts_check_screen_reader_on(tts_h tts, bool* is_on);
699 * @brief Adds a text to the queue.
701 * @remarks Locale(e.g. setlocale()) MUST be set for utf8 text validation check.
702 * @param[in] tts The TTS handle
703 * @param[in] text An input text based utf8
704 * @param[in] language The language selected from the tts_foreach_supported_voices() (e.g. 'NULL'(Automatic), 'en_US')
705 * @param[in] voice_type The voice type selected from the tts_foreach_supported_voices() (e.g. #TTS_VOICE_TYPE_AUTO, #TTS_VOICE_TYPE_FEMALE)
706 * @param[in] speed A speaking speed (e.g. #TTS_SPEED_AUTO or the value from tts_get_speed_range())
707 * @param[out] utt_id The utterance ID passed to the callback function
708 * @return @c 0 on success,
709 * otherwise a negative error value
710 * @retval #TTS_ERROR_NONE Successful
711 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
712 * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
713 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
714 * @retval #TTS_ERROR_INVALID_STATE Invalid state
715 * @retval #TTS_ERROR_INVALID_VOICE Invalid voice about language, voice type
716 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
717 * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
718 * @pre The state should be #TTS_STATE_READY, #TTS_STATE_PLAYING or #TTS_STATE_PAUSED.
719 * @see tts_get_max_text_size()
720 * @see tts_set_credential()
722 int tts_add_text(tts_h tts, const char* text, const char* language, int voice_type, int speed, int* utt_id);
726 * @brief Starts synthesizing voice from the text and plays the synthesized audio data.
728 * @param[in] tts The TTS handle
729 * @return @c 0 on success,
730 * otherwise a negative error value
731 * @retval #TTS_ERROR_NONE Successful
732 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
733 * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
734 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
735 * @retval #TTS_ERROR_OUT_OF_NETWORK Out of network
736 * @retval #TTS_ERROR_INVALID_STATE Invalid state
737 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
738 * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
739 * @pre The current state should be #TTS_STATE_READY or #TTS_STATE_PAUSED.
740 * @post If this function succeeds, the TTS state will be #TTS_STATE_PLAYING.
741 * @see tts_add_text()
744 * @see tts_utterance_started_cb()
745 * @see tts_utterance_completed_cb()
746 * @see tts_error_cb()
747 * @see tts_set_credential()
749 int tts_play(tts_h tts);
753 * @brief Stops playing the utterance and clears the queue.
755 * @param[in] tts The TTS handle
756 * @return @c 0 on success,
757 * otherwise a negative error value
758 * @retval #TTS_ERROR_NONE Successful
759 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
760 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
761 * @retval #TTS_ERROR_INVALID_STATE Invalid state
762 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
763 * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
764 * @pre The TTS state should be #TTS_STATE_READY or #TTS_STATE_PLAYING or #TTS_STATE_PAUSED.
765 * @post If this function succeeds, the TTS state will be #TTS_STATE_READY.
766 * This function will remove all text via tts_add_text() and synthesized sound data.
770 int tts_stop(tts_h tts);
774 * @brief Pauses the currently playing utterance.
776 * @param[in] tts The TTS handle
777 * @return @c 0 on success,
778 * otherwise a negative error value
779 * @retval #TTS_ERROR_NONE Successful
780 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
781 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
782 * @retval #TTS_ERROR_INVALID_STATE Invalid state
783 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
784 * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
785 * @pre The TTS state should be #TTS_STATE_PLAYING.
786 * @post If this function succeeds, the TTS state will be #TTS_STATE_PAUSED.
789 * @see tts_error_cb()
791 int tts_pause(tts_h tts);
794 * @brief Repeats the last added text.
796 * @remarks This function repeats the last added text once again.
797 * If there is no previously added text, this function will not work.
798 * If the language is changed, the last added text is removed from the service.
799 * Before calling this function, please call 'tts_stop()' in order to stop playing the previous one.
800 * If this function succeeds, @a text_repeat must be released with free().
801 * @param[in] tts The TTS handle
802 * @param[out] text_repeat Texts to be played repeatedly
803 * @param[out] utt_id The utterance ID passed to the callback function
805 * @return @c 0 on success,
806 * otherwise a negative error value
807 * @retval #TTS_ERROR_NONE Successful
808 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
809 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
810 * @retval #TTS_ERROR_INVALID_STATE Invalid state
811 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
812 * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
813 * @pre The state should be #TTS_STATE_READY.
814 * @post If this function succeeds, the TTS state will be #TTS_STATE_PLAYING.
815 * @see tts_add_text()
818 int tts_repeat(tts_h tts, char** text_repeat, int* utt_id);
821 * @brief Sets a callback function to be called when the TTS state changes.
823 * @param[in] tts The TTS handle
824 * @param[in] callback The callback function to register
825 * @param[in] user_data The user data to be passed to the callback function
826 * @return @c 0 on success,
827 * otherwise a negative error value
828 * @retval #TTS_ERROR_NONE Successful
829 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
830 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
831 * @retval #TTS_ERROR_INVALID_STATE Invalid state
832 * @pre The state should be #TTS_STATE_CREATED.
833 * @see tts_state_changed_cb()
834 * @see tts_unset_state_changed_cb()
836 int tts_set_state_changed_cb(tts_h tts, tts_state_changed_cb callback, void* user_data);
840 * @brief Unsets the callback function to be called when the TTS state changes.
842 * @param[in] tts The TTS handle
843 * @return @c 0 on success,
844 * otherwise a negative error value
845 * @retval #TTS_ERROR_NONE Successful
846 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
847 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
848 * @retval #TTS_ERROR_INVALID_STATE Invalid state
849 * @pre The state should be #TTS_STATE_CREATED.
850 * @see tts_set_state_changed_cb()
852 int tts_unset_state_changed_cb(tts_h tts);
856 * @brief Sets a callback function to detect utterance start.
858 * @param[in] tts The TTS handle
859 * @param[in] callback The callback function to register
860 * @param[in] user_data The user data to be passed to the callback function
861 * @return @c 0 on success,
862 * otherwise a negative error value
863 * @retval #TTS_ERROR_NONE Successful
864 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
865 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
866 * @retval #TTS_ERROR_INVALID_STATE Invalid state
867 * @pre The state should be #TTS_STATE_CREATED.
868 * @see tts_utterance_started_cb()
869 * @see tts_unset_utterance_started_cb()
871 int tts_set_utterance_started_cb(tts_h tts, tts_utterance_started_cb callback, void* user_data);
875 * @brief Unsets the callback function to detect utterance start.
877 * @param[in] tts The TTS handle
878 * @return @c 0 on success,
879 * otherwise a negative error value
880 * @retval #TTS_ERROR_NONE Successful
881 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
882 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
883 * @retval #TTS_ERROR_INVALID_STATE Invalid state
884 * @pre The state should be #TTS_STATE_CREATED.
885 * @see tts_set_utterance_started_cb()
887 int tts_unset_utterance_started_cb(tts_h tts);
891 * @brief Sets a callback function to detect utterance completion.
893 * @param[in] tts The TTS handle
894 * @param[in] callback The callback function to register
895 * @param[in] user_data The user data to be passed to the callback function
896 * @return @c 0 on success,
897 * otherwise a negative error value
898 * @retval #TTS_ERROR_NONE Successful
899 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
900 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
901 * @retval #TTS_ERROR_INVALID_STATE Invalid state
902 * @pre The state should be #TTS_STATE_CREATED.
903 * @see tts_utterance_completed_cb()
904 * @see tts_unset_utterance_completed_cb()
906 int tts_set_utterance_completed_cb(tts_h tts, tts_utterance_completed_cb callback, void* user_data);
910 * @brief Unsets the callback function to detect utterance completion.
912 * @param[in] tts The TTS handle
913 * @return @c 0 on success,
914 * otherwise a negative error value
915 * @retval #TTS_ERROR_NONE Successful
916 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
917 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
918 * @retval #TTS_ERROR_INVALID_STATE Invalid state
919 * @pre The state should be #TTS_STATE_CREATED.
920 * @see tts_set_utterance_completed_cb()
922 int tts_unset_utterance_completed_cb(tts_h tts);
926 * @brief Sets a callback function to detect errors.
928 * @param[in] tts The TTS handle
929 * @param[in] callback The callback function to register
930 * @param[in] user_data The user data to be passed to the callback function
931 * @return @c 0 on success,
932 * otherwise a negative error value
933 * @retval #TTS_ERROR_NONE Successful
934 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
935 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
936 * @retval #TTS_ERROR_INVALID_STATE Invalid state
937 * @pre The state should be #TTS_STATE_CREATED.
938 * @see tts_error_cb()
939 * @see tts_unset_error_cb()
941 int tts_set_error_cb(tts_h tts, tts_error_cb callback, void* user_data);
945 * @brief Unsets the callback function to detect errors.
947 * @param[in] tts The TTS handle
948 * @return @c 0 on success,
949 * otherwise a negative error value
950 * @retval #TTS_ERROR_NONE Successful
951 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
952 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
953 * @retval #TTS_ERROR_INVALID_STATE Invalid state
954 * @pre The state should be #TTS_STATE_CREATED.
955 * @see tts_set_error_cb()
957 int tts_unset_error_cb(tts_h tts);
961 * @brief Sets a callback function to detect default voice change.
963 * @param[in] tts The TTS handle
964 * @param[in] callback The callback function to register
965 * @param[in] user_data The user data to be passed to the callback function
966 * @return @c 0 on success,
967 * otherwise a negative error value
968 * @retval #TTS_ERROR_NONE Successful
969 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
970 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
971 * @retval #TTS_ERROR_INVALID_STATE Invalid state
972 * @pre The state should be #TTS_STATE_CREATED.
973 * @see tts_default_voice_changed_cb()
974 * @see tts_unset_default_voice_changed_cb()
976 int tts_set_default_voice_changed_cb(tts_h tts, tts_default_voice_changed_cb callback, void* user_data);
980 * @brief Unsets the callback function to detect default voice change.
982 * @param[in] tts The TTS handle
983 * @return @c 0 on success,
984 * otherwise a negative error value
985 * @retval #TTS_ERROR_NONE Successful
986 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
987 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
988 * @retval #TTS_ERROR_INVALID_STATE Invalid state
989 * @pre The state should be #TTS_STATE_CREATED.
990 * @see tts_set_default_voice_changed_cb()
992 int tts_unset_default_voice_changed_cb(tts_h tts);
996 * @brief Sets a callback function to detect the engine change.
998 * @param[in] tts The TTS handle
999 * @param[in] callback The callback function to register
1000 * @param[in] user_data The user data to be passed to the callback function
1001 * @return @c 0 on success,
1002 * otherwise a negative error value
1003 * @retval #TTS_ERROR_NONE Successful
1004 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1005 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1006 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1007 * @pre The state should be #TTS_STATE_CREATED.
1008 * @see tts_engine_changed_cb()
1009 * @see tts_unset_engine_changed_cb()
1011 int tts_set_engine_changed_cb(tts_h tts, tts_engine_changed_cb callback, void* user_data);
1015 * @brief Unsets the callback function to detect the engine change.
1017 * @param[in] tts The TTS handle
1018 * @return @c 0 on success,
1019 * otherwise a negative error value
1020 * @retval #TTS_ERROR_NONE Successful
1021 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1022 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1023 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1024 * @pre The state should be #TTS_STATE_CREATED.
1025 * @see tts_set_engine_changed_cb()
1027 int tts_unset_engine_changed_cb(tts_h tts);
1031 * @brief Sets a callback function to detect the option of screen reader is changed or not.
1033 * @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.
1034 * @param[in] tts The TTS handle
1035 * @param[in] callback The callback function to register
1036 * @param[in] user_data The user data to be passed to the callback function
1037 * @return @c 0 on success,
1038 * otherwise a negative error value
1039 * @retval #TTS_ERROR_NONE Successful
1040 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1041 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1042 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1043 * @pre The state should be #TTS_STATE_CREATED.
1044 * @see tts_screen_reader_changed_cb()
1045 * @see tts_unset_screen_reader_changed_cb()
1047 int tts_set_screen_reader_changed_cb(tts_h tts, tts_screen_reader_changed_cb callback, void* user_data);
1051 * @brief Unsets the callback function to detect the option of screen reader is changed or not.
1053 * @param[in] tts The TTS handle
1054 * @return @c 0 on success,
1055 * otherwise a negative error value
1056 * @retval #TTS_ERROR_NONE Successful
1057 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1058 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1059 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1060 * @pre The state should be #TTS_STATE_CREATED.
1061 * @see tts_set_screen_reader_changed_cb()
1063 int tts_unset_screen_reader_changed_cb(tts_h tts);
1067 * @brief Sets a callback function to be called when the TTS service state changes.
1069 * @param[in] tts The TTS handle
1070 * @param[in] callback The callback function to register
1071 * @param[in] user_data The user data to be passed to the callback function
1072 * @return @c 0 on success,
1073 * otherwise a negative error value
1074 * @retval #TTS_ERROR_NONE Successful
1075 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1076 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1077 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1078 * @pre The TTS state should be #TTS_STATE_CREATED.
1079 * @see tts_service_state_changed_cb()
1080 * @see tts_unset_service_state_changed_cb()
1082 int tts_set_service_state_changed_cb(tts_h tts, tts_service_state_changed_cb callback, void* user_data);
1086 * @brief Unsets the callback function to be called when the TTS service state changes.
1088 * @param[in] tts The TTS handle
1089 * @return @c 0 on success,
1090 * otherwise a negative error value
1091 * @retval #TTS_ERROR_NONE Successful
1092 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1093 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1094 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1095 * @pre The TTS state should be #TTS_STATE_CREATED.
1096 * @see tts_set_service_state_changed_cb()
1098 int tts_unset_service_state_changed_cb(tts_h tts);
1102 * @brief Sets the TTS playing mode.
1104 * @param[in] tts The TTS handle
1105 * @param[in] mode The mode
1106 * @return @c 0 on success,
1107 * otherwise a negative error value
1108 * @retval #TTS_ERROR_NONE Successful
1109 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1110 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1111 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1112 * @pre The state should be #TTS_STATE_CREATED.
1113 * @see tts_get_playing_mode()
1116 int tts_set_playing_mode(tts_h tts, tts_playing_mode_e mode);
1120 * @brief Sets the callback function to receive the synthesized pcm data from the tts service.
1122 * @param[in] tts The TTS handle
1123 * @param[in] callback The callback function to register
1124 * @param[in] user_data The user data to be passed to the callback function
1125 * @return @c 0 on success,
1126 * otherwise a negative error value
1127 * @retval #TTS_ERROR_NONE Successful
1128 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1129 * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
1130 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1131 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1132 * @pre The TTS state should be #TTS_STATE_CREATED.
1133 * @see tts_synthesized_pcm_cb()
1134 * @see tts_unset_synthesized_pcm_cb()
1136 int tts_set_synthesized_pcm_cb(tts_h tts, tts_synthesized_pcm_cb callback, void* user_data);
1140 * @brief Unsets the callback function to receive synthesized PCM data from the tts service.
1142 * @param[in] tts The TTS handle
1143 * @return @c 0 on success,
1144 * otherwise a negative error value
1145 * @retval #TTS_ERROR_NONE Successful
1146 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1147 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1148 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1149 * @pre The TTS state should be #TTS_STATE_CREATED.
1150 * @see tts_set_synthesized_pcm_cb()
1152 int tts_unset_synthesized_pcm_cb(tts_h tts);
1156 * @brief Adds silence for the specified amount of time
1158 * @remarks The maximum silent time is 5000 msec. If you want to perform a silent time of more than 5000 msec, call this function several times.
1159 * @param[in] tts The TTS handle
1160 * @param[in] duration_in_msec The duration of the silence
1161 * @param[out] utt_id The utterance ID passed to the callback function
1162 * @return @c 0 on success,
1163 * otherwise a negative error value
1164 * @retval #TTS_ERROR_NONE Successful
1165 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1166 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1167 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1168 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
1169 * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
1170 * @pre The state should be #TTS_STATE_READY, #TTS_STATE_PLAYING, or #TTS_STATE_PAUSED.
1172 int tts_add_silent_utterance(tts_h tts, unsigned int duration_in_msec, int* utt_id);
1176 * @brief Creates a handle for TTS synthesis parameters.
1178 * @remarks If the function succeeds, @a paramter handle must be released with tts_synthesis_parameter_destroy().
1179 * @param[out] parameter The TTS synthesis parameter handle
1180 * @return @c 0 on success,
1181 * otherwise a negative error value
1182 * @retval #TTS_ERROR_NONE Successful
1183 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1184 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1185 * @retval #TTS_ERROR_OUT_OF_MEMORY Out of memory
1186 * @see tts_synthesis_parameter_destroy()
1188 int tts_synthesis_parameter_create(tts_synthesis_parameter_h *parameter);
1191 * @brief Destroys the TTS synthesis paramter handle.
1193 * @param[in] parameter The TTS synthesis parameter handle
1194 * @return @c 0 on success,
1195 * otherwise a negative error value
1196 * @retval #TTS_ERROR_NONE Successful
1197 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1198 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1199 * @see tts_synthesis_parameter_create()
1201 int tts_synthesis_parameter_destroy(tts_synthesis_parameter_h parameter);
1204 * @brief Sets the language.
1206 * @param[in] parameter The TTS synthesis parameter handle
1207 * @param[in] language The language selected from the tts_foreach_supported_voices() (e.g. 'NULL'(Automatic), 'en_US')
1208 * @return @c 0 on success,
1209 * otherwise a negative error value
1210 * @retval #TTS_ERROR_NONE Successful
1211 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1212 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1213 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
1214 * @retval #TTS_ERROR_OUT_OF_MEMORY Out of memory
1216 int tts_synthesis_parameter_set_language(tts_synthesis_parameter_h parameter, const char *language);
1219 * @brief Sets the voice type.
1221 * @param[in] parameter The TTS synthesis parameter handle
1222 * @param[in] voice_type The voice type selected from the tts_foreach_supported_voices() (e.g. #TTS_VOICE_TYPE_AUTO, #TTS_VOICE_TYPE_FEMALE)
1223 * @return @c 0 on success,
1224 * otherwise a negative error value
1225 * @retval #TTS_ERROR_NONE Successful
1226 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1227 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1229 int tts_synthesis_parameter_set_voice_type(tts_synthesis_parameter_h parameter, int voice_type);
1232 * @brief Sets the ID for personal voice data.
1234 * @param[in] parameter The TTS synthesis parameter handle
1235 * @param[in] ptts_id The id for personal voice data
1236 * @return @c 0 on success,
1237 * otherwise a negative error value
1238 * @retval #TTS_ERROR_NONE Successful
1239 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1240 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1241 * @retval #TTS_ERROR_OUT_OF_MEMORY Out of memory
1243 int tts_synthesis_parameter_set_personal_voice(tts_synthesis_parameter_h parameter, const char *ptts_id);
1246 * @brief Sets the speed.
1248 * @param[in] parameter The TTS synthesis parameter handle
1249 * @param[in] speed A speaking speed (e.g. #TTS_SPEED_AUTO or the value from tts_get_speed_range())
1250 * @return @c 0 on success,
1251 * otherwise a negative error value
1252 * @retval #TTS_ERROR_NONE Successful
1253 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1254 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1255 * @see tts_get_speed_range()
1257 int tts_synthesis_parameter_set_speed(tts_synthesis_parameter_h parameter, int speed);
1260 * @brief Sets the pitch.
1262 * @param[in] parameter The TTS synthesis parameter handle
1263 * @param[in] pitch A speaking pitch (e.g. #TTS_PITCH_AUTO or the value from tts_get_pitch_range())
1264 * @return @c 0 on success,
1265 * otherwise a negative error value
1266 * @retval #TTS_ERROR_NONE Successful
1267 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1268 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1269 * @see tts_get_pitch_range()
1271 int tts_synthesis_parameter_set_pitch(tts_synthesis_parameter_h parameter, int pitch);
1274 * @brief Sets the volume.
1276 * @param[in] parameter The TTS synthesis parameter handle
1277 * @param[in] volume A speaking volume ratio (e.g. #TTS_VOLUME_AUTO or the value from tts_get_volume_range())
1278 * @return @c 0 on success,
1279 * otherwise a negative error value
1280 * @retval #TTS_ERROR_NONE Successful
1281 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1282 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1283 * @see tts_get_volume_range()
1285 int tts_synthesis_parameter_set_volume(tts_synthesis_parameter_h parameter, double volume);
1288 * @brief Sets the background volume ratio.
1290 * @param[in] parameter The TTS synthesis parameter handle
1291 * @param[in] background_volume_ratio A background volume ratio ratio (Range 0.0 ~ 1.0)
1292 * @return @c 0 on success,
1293 * otherwise a negative error value
1294 * @retval #TTS_ERROR_NONE Successful
1295 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1296 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1298 int tts_synthesis_parameter_set_background_volume_ratio(tts_synthesis_parameter_h parameter, double background_volume_ratio);
1301 * @brief Gets the pitch range.
1303 * @param[in] tts The TTS handle
1304 * @param[out] min The minimum pitch value
1305 * @param[out] normal The normal pitch value
1306 * @param[out] max The maximum pitch value
1307 * @return @c 0 on success,
1308 * otherwise a negative error value
1309 * @retval #TTS_ERROR_NONE Successful
1310 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1311 * @retval #TTS_ERROR_NOT_SUPPORTED_FEATURE Not supported feature.
1312 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1313 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1314 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
1315 * @pre The state should be #TTS_STATE_READY.
1316 * @see tts_synthesis_parameter_set_pitch()
1318 int tts_get_pitch_range(tts_h tts, int* min, int* normal, int* max);
1321 * @brief Gets the volume range.
1323 * @param[in] tts The TTS handle
1324 * @param[out] min The minimum volume value
1325 * @param[out] max The maximum volume value
1326 * @return @c 0 on success,
1327 * otherwise a negative error value
1328 * @retval #TTS_ERROR_NONE Successful
1329 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1330 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1331 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1332 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
1333 * @pre The state should be #TTS_STATE_READY.
1334 * @see tts_synthesis_parameter_set_volume()
1336 int tts_get_volume_range(tts_h tts, int* min, int* max);
1339 * @brief Adds a text to the queue with synthesis parameter.
1341 * @remarks Locale(e.g. setlocale()) MUST be set for utf8 text validation check.
1342 * @param[in] tts The TTS handle
1343 * @param[in] text An input text based utf8
1344 * @param[in] parameter The TTS synthesis parameter handle
1345 * @param[out] utt_id The utterance ID passed to the callback function
1346 * @return @c 0 on success,
1347 * otherwise a negative error value
1348 * @retval #TTS_ERROR_NONE Successful
1349 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
1350 * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
1351 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
1352 * @retval #TTS_ERROR_INVALID_STATE Invalid state
1353 * @retval #TTS_ERROR_INVALID_VOICE Invalid voice about language, voice type
1354 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
1355 * @retval #TTS_ERROR_SCREEN_READER_OFF Screen reader is turned off
1356 * @pre The state should be #TTS_STATE_READY, #TTS_STATE_PLAYING or #TTS_STATE_PAUSED.
1357 * @see tts_get_max_text_size()
1358 * @see tts_set_credential()
1360 int tts_add_text_with_synthesis_parameter(tts_h tts, const char* text, tts_synthesis_parameter_h parameter, int* utt_id);
1372 #endif /* __TTS_H__ */