* @since_tizen 4.0
*
* @param[in] tts The TTS handle
- * @param[in] event An event about pcm buffer (-1: error, 1: start, 2: continue, 3: finish)
+ * @param[in] event An event about pcm buffer (-1: error, 1: start, 2: continue, 3: finish)
* @param[in] data The pcm data buffer
* @param[in] data_size The data size of pcm data buffer
* @param[in] audio_type The audio type of pcm (0: signed 16-bit, 1: unsigned 8-bit)
* @param[in] rate The sampling rate of pcm
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #TTS_ERROR_NONE Successful
* @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 4.0
*
* @param[in] tts The TTS handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #TTS_ERROR_NONE Successful
* @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 4.0
*
* @param[in] tts The TTS handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #TTS_ERROR_NONE Successful
* @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
int tts_stop_pcm(tts_h tts);
-/**
- * @brief Connects the daemon asynchronously.
- * @since_tizen 5.0
- * @param[in] tts The TTS handle
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #TTS_ERROR_NONE Successful
- * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #TTS_ERROR_INVALID_STATE Invalid state
- * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
- * @pre The state should be #TTS_STATE_CREATED.
- * @post If this function is successful, the TTS state will be #TTS_STATE_READY.
- * If this function is failed, the error callback is called. (e.g. #TTS_ERROR_ENGINE_NOT_FOUND)
- * @see tts_unprepare()
-*/
-int tts_prepare_sync(tts_h tts);
-
#ifdef __cplusplus
}
* For example, "ko_KR" for Korean, "en_US" for American English
* @param[in] type The voice type
* @param[in] user_data The user data passed from ttse_foreach_supported_voices_cb()
-* @return @c true to continue with the next iteration of the loop
+* @return @c true to continue with the next iteration of the loop
* @c false to break out of the loop
* @pre ttse_foreach_supported_voices_cb() will invoke this callback function.
* @see ttse_foreach_supported_voices_cb()
* @brief Called when the engine service user initializes TTS engine.
* @since_tizen 3.0
* @remarks This callback function is mandatory and must be registered using ttse_main().
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks This callback function is mandatory and must be registered using ttse_main().
* NOTE that the engine may be terminated automatically.
* When this callback function is invoked, the release of resources is necessary.
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_STATE Not initialized
* If 'ttse_supported_voice_cb()' returns @c false, it should be stopped to call 'ttse_supported_voice_cb()'.
* @param[in] callback The callback function
* @param[in] user_data The user data which must be passed to ttse_supported_voice_cb()
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* followed by ISO 639-1 for the two-letter language code.
* For example, "ko_KR" for Korean, "en_US" for American English
* @param[in] type The voice type
-* @param[out] is_valid A variable for checking whether the corresponding voice is valid or not.
+* @param[out] is_valid A variable for checking whether the corresponding voice is valid or not.
* @c true to be valid,
* @c false to be invalid
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 3.0
* @remarks This callback function is mandatory and must be registered using ttse_main().
* @param[in] pitch The default pitch
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* followed by ISO 639-1 for the two-letter language code.
* For example, "ko_KR" for Korean, "en_US" for American English
* @param[in] type The voice type
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* followed by ISO 639-1 for the two-letter language code.
* For example, "ko_KR" for Korean, "en_US" for American English
* @param[in] type The voice type
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @param[out] is_agreed A variable for checking whether the application agreed to use TTS engine or not.
* @c true to agree,
* @c false to disagree
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_STATE Not initialized
* @param[in] appid The Application ID
* @param[in] credential The credential granted to the application
* @param[in] user_data The user data which must be passed to ttse_send_result()
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @brief Called when the engine service user cancels to synthesize a voice.
* @since_tizen 3.0
* @remarks This callback function is mandatory and must be registered using ttse_main().
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_STATE Not initialized or not started synthesis
* @param[out] engine_name Name of engine
* @param[out] engine_setting The engine setting application(ui app)'s app ID
* @param[out] use_network The status for using network
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error code on failure
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks This callback function is optional and is registered using ttse_set_private_data_set_cb().
* @param[in] key The key field of private data
* @param[in] data The data field of private data
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks This callback function is optional and is registered using ttse_set_private_data_requested_cb().
* @param[out] key The key field of private data
* @param[out] data The data field of private data
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] argc The argument count(original)
* @param[in] argv The argument(original)
* @param[in] callback The structure of engine request callback function
-* @return This function returns zero on success,
+* @return This function returns zero on success,
* or negative with error code on failure
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
int ttse_main(int argc, char** argv, ttse_request_callback_s *callback);
+/**
+* @brief Terminates the main function of TTS engine.
+* @since_tizen 7.0
+* @remarks This function invokes ttse_deinitialize_cb() in #ttse_request_callback_s which is registered by ttse_main().
+* And this function should be called before terminating the engine to ensure safe termination.
+* @return @c 0 on success,
+* otherwise a negative error value
+* @retval #TTSE_ERROR_NONE Successful
+* @retval #TTSE_ERROR_OPERATION_FAILED Operation failure
+*/
+int ttse_terminate(void);
+
+
/**
* @brief Gets the speed range from Tizen platform.
* @since_tizen 3.0
* @param[out] min The minimum speed value
* @param[out] normal The normal speed value
* @param[out] max The maximum speed value
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @param[out] min The minimum pitch value
* @param[out] normal The normal pitch value
* @param[out] max The maximum pitch value
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] audio_type The audio type
* @param[in] rate The sample rate
* @param[in] user_data The user data passed from ttse_start_synthesis_cb()
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 3.0
* @param[in] error The error reason
* @param[in] msg The error message
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 3.0
* @remarks The ttse_private_data_set_cb() function is called when the engine service user sends the private data.
* @param[in] callback_func ttse_private_data_set event callback function
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 3.0
* @remarks The ttse_private_data_requested_cb() function is called when the engine service user gets the private data from TTS engine.
* @param[in] callback_func ttse_private_data_requested event callback function
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter