Implement IPC in client side for Synthesis parameter APIs 00/310500/3
authorsungwook79.park <sungwook79.park@samsung.com>
Tue, 30 Apr 2024 04:38:12 +0000 (13:38 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Thu, 16 May 2024 09:02:54 +0000 (18:02 +0900)
Change-Id: I44aeb72fd8404dadd4b1bb1a4064058f3d36df45
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
12 files changed:
client/tts.c
client/tts_core.c
client/tts_core.h
client/tts_dbus.c
client/tts_dbus.h
client/tts_ipc.c
client/tts_ipc.h
client/tts_main.h
client/tts_tidl.c
client/tts_tidl.h
common/tts_defs.h
tidl/tts.tidl

index a6af184..c100cc1 100644 (file)
@@ -1421,6 +1421,40 @@ int tts_unset_synthesized_pcm_cb(tts_h tts)
        return TTS_ERROR_NONE;
 }
 
+int tts_add_silent_utterance(tts_h tts, unsigned int duration_in_msec, int* utt_id)
+{
+       RETV_IF(TTS_ERROR_NONE != __tts_get_feature_enabled(), TTS_ERROR_NOT_SUPPORTED);
+
+       tts_client_s* client = tts_client_get(tts);
+       RETVM_IF(NULL == client, TTS_ERROR_INVALID_PARAMETER, "[ERROR] A handle is not valid. tts(%p)", tts);
+       RETVM_IF(NULL == utt_id, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input parameter is null.");
+
+       tts_state_e current_state = tts_client_get_current_state(client);
+       RETVM_IF(TTS_STATE_CREATED == current_state, TTS_ERROR_INVALID_STATE, "[ERROR] The current state(%d) is invalid", current_state);
+
+       RETVM_IF(false == tts_core_check_screen_reader(client), TTS_ERROR_SCREEN_READER_OFF, "[ERROR] Screen reader option is not available");
+       RETVM_IF(false == tts_core_check_credential(client), TTS_ERROR_PERMISSION_DENIED, "[ERROR] Do not have app credential for this engine");
+
+       if (duration_in_msec < 0) {
+               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to add silent. The duration of silent should be above than zero.");
+               return TTS_ERROR_INVALID_PARAMETER;
+       }
+
+       if (duration_in_msec > MAX_SILENT_DURATION) {
+               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to add silent. The max duration for silent is 5000 msec");
+               return TTS_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = tts_core_add_silent_utterance(client, duration_in_msec, utt_id);
+       if (TTS_ERROR_NONE != ret) {
+               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to request add silent. ret(%s)", tts_core_covert_error_code(ret));
+               return ret;
+       }
+
+       SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
+       return TTS_ERROR_NONE;
+}
+
 int tts_synthesis_parameter_create(tts_synthesis_parameter_h *parameter)
 {
        SLOG(LOG_INFO, TAG_TTSC, "@@@ Create TTS synthesis parameter handle");
@@ -1444,8 +1478,8 @@ int tts_synthesis_parameter_destroy(tts_synthesis_parameter_h parameter)
 
        RETVM_IF(NULL == parameter, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input handle is null");
 
-       free(parameter->langauge);
-       parameter->langauge = NULL;
+       free(parameter->language);
+       parameter->language = NULL;
        free(parameter->ptts_id);
        parameter->ptts_id = NULL;
 
@@ -1462,11 +1496,11 @@ int tts_synthesis_parameter_set_language(tts_synthesis_parameter_h parameter, co
 
        RETVM_IF(NULL == parameter || NULL == language, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input handle is null");
 
-       char *new_langauge = strdup(language);
-       RETVM_IF(NULL == new_langauge, TTS_ERROR_OUT_OF_MEMORY, "[ERROR] Fail to allocate memory for language");
+       char *new_language = strdup(language);
+       RETVM_IF(NULL == new_language, TTS_ERROR_OUT_OF_MEMORY, "[ERROR] Fail to allocate memory for language");
 
-       free(parameter->langauge);
-       parameter->langauge = new_langauge;
+       free(parameter->language);
+       parameter->language = new_language;
 
        SLOG(LOG_DEBUG, TAG_TTSC, "[SUCCESS] Set language(%s) to a synthesis parameter", language);
        return TTS_ERROR_NONE;
@@ -1559,13 +1593,54 @@ int tts_synthesis_parameter_set_background_volume_ratio(tts_synthesis_parameter_
        return TTS_ERROR_NONE;
 }
 
-int tts_add_silent_utterance(tts_h tts, unsigned int duration_in_msec, int* utt_id)
+int tts_get_pitch_range(tts_h tts, int* min, int* normal, int* max)
 {
        RETV_IF(TTS_ERROR_NONE != __tts_get_feature_enabled(), TTS_ERROR_NOT_SUPPORTED);
 
+       SLOG(LOG_DEBUG, TAG_TTSC, "@@@ Get pitch range");
+
+       RETVM_IF(NULL == min || NULL == normal || NULL == max, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input parameter is null");
+
+       tts_client_s* client = tts_client_get(tts);
+       RETVM_IF(NULL == client, TTS_ERROR_INVALID_PARAMETER, "[ERROR] A handle is not valid. tts(%p)", tts);
+
+       *min = 0;
+       *normal = 0;
+       *max = 0;
+
+       return TTS_ERROR_NONE;
+}
+
+int tts_get_volume_range(tts_h tts, int* min, int* max)
+{
+       RETV_IF(TTS_ERROR_NONE != __tts_get_feature_enabled(), TTS_ERROR_NOT_SUPPORTED);
+
+       SLOG(LOG_DEBUG, TAG_TTSC, "@@@ Get volume range");
+
+       RETVM_IF(NULL == min || NULL == max, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input parameter is null");
+
+       tts_client_s* client = tts_client_get(tts);
+       RETVM_IF(NULL == client, TTS_ERROR_INVALID_PARAMETER, "[ERROR] A handle is not valid. tts(%p)", tts);
+
+       *min = 0;
+       *max = 0;
+
+       return TTS_ERROR_NONE;
+}
+
+int tts_add_text_with_synthesis_parameter(tts_h tts, const char* text, tts_synthesis_parameter_h parameter, int* utt_id)
+{
+       RETV_IF(TTS_ERROR_NONE != __tts_get_feature_enabled(), TTS_ERROR_NOT_SUPPORTED);
+
+       SLOG(LOG_ERROR, TAG_TTSC, "[INFO] Add text with synthesis parameter: text(%s), language(%s), ptts_id(%s), type(%d), speed(%d), pitch(%d), volume(%lf), background_volume(%lf)",
+       (NULL == text) ? "NULL" : text, (NULL == parameter->language) ? "NULL" : parameter->language, (NULL == parameter->ptts_id) ? "NULL" : parameter->ptts_id, parameter->voice_type, parameter->speed, parameter->pitch, parameter->volume, parameter->background_volume_ratio);
+
+       RETVM_IF(NULL == parameter, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input parameter is null");
+       RETVM_IF(NULL == utt_id, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input parameter is null");
+       RETVM_IF(false == tts_core_is_valid_text(text), TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input text is invalid");
+
        tts_client_s* client = tts_client_get(tts);
        RETVM_IF(NULL == client, TTS_ERROR_INVALID_PARAMETER, "[ERROR] A handle is not valid. tts(%p)", tts);
-       RETVM_IF(NULL == utt_id, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input parameter is null.");
 
        tts_state_e current_state = tts_client_get_current_state(client);
        RETVM_IF(TTS_STATE_CREATED == current_state, TTS_ERROR_INVALID_STATE, "[ERROR] The current state(%d) is invalid", current_state);
@@ -1573,19 +1648,9 @@ int tts_add_silent_utterance(tts_h tts, unsigned int duration_in_msec, int* utt_
        RETVM_IF(false == tts_core_check_screen_reader(client), TTS_ERROR_SCREEN_READER_OFF, "[ERROR] Screen reader option is not available");
        RETVM_IF(false == tts_core_check_credential(client), TTS_ERROR_PERMISSION_DENIED, "[ERROR] Do not have app credential for this engine");
 
-       if (duration_in_msec < 0) {
-               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to add silent. The duration of silent should be above than zero.");
-               return TTS_ERROR_INVALID_PARAMETER;
-       }
-
-       if (duration_in_msec > MAX_SILENT_DURATION) {
-               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to add silent. The max duration for silent is 5000 msec");
-               return TTS_ERROR_INVALID_PARAMETER;
-       }
-
-       int ret = tts_core_add_silent_utterance(client, duration_in_msec, utt_id);
+       int ret = tts_core_add_text_with_synthesis_parameter(client, text, parameter, utt_id);
        if (TTS_ERROR_NONE != ret) {
-               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to request add silent. ret(%s)", tts_core_covert_error_code(ret));
+               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to request add text. ret(%s)", tts_core_covert_error_code(ret));
                return ret;
        }
 
index 0f5eeec..e43f126 100644 (file)
@@ -692,6 +692,34 @@ static inline int __request_add_silent_utterance(tts_client_s* client, unsigned
        return TTS_ERROR_NONE;
 }
 
+static inline int __request_add_text_with_synthesis_parameter(tts_client_s* client, const char* text, tts_synthesis_parameter_h parameter, int* utt_id)
+{
+       int new_utt_id = tts_client_new_utterance_id(client);
+       if (0 > new_utt_id) {
+               return TTS_ERROR_OPERATION_FAILED;
+       }
+
+       // TODO: If use cpp, remove dupliceated code using command class pattern
+       unsigned int uid = tts_client_get_uid(client);
+       int ret = -1;
+       tts_client_set_reprepared(client, false);
+       for (int count = 0; count < TTS_RETRY_COUNT; count++) {
+               ret = tts_ipc_request_add_text_with_synthesis_parameter(uid, text, parameter, new_utt_id, client->credential);
+               if (false == __is_ipc_retry_needed(client, ret)) {
+                       break;
+               }
+       }
+
+       if (TTS_ERROR_NONE != ret) {
+               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to request");
+               return ret;
+       }
+
+       SLOG(LOG_INFO, TAG_TTSC, "[INFO] Success __request_add_text_with_synthesis_parameter");
+       *utt_id = new_utt_id;
+       return TTS_ERROR_NONE;
+}
+
 static inline int __request_play(tts_client_s* client)
 {
        unsigned int uid = tts_client_get_uid(client);
@@ -1392,6 +1420,16 @@ int tts_core_add_text(tts_client_s* client, const char* text, const char* langua
        return __request_add_text(client, text, language, voice_type, speed, utt_id);
 }
 
+int tts_core_add_text_with_synthesis_parameter(tts_client_s* client, const char* text, tts_synthesis_parameter_h parameter, int* utt_id)
+{
+       RETVM_IF(NULL == text || NULL == parameter || NULL == utt_id, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Parameter is invalid.");
+       RETVM_IF(false == tts_client_is_valid_client(client), TTS_ERROR_INVALID_PARAMETER, "[ERROR] Client is invalid.");
+       reprepare_on_demand(client);
+
+       SLOG(LOG_ERROR, TAG_TTSC, "[DEBUG] text(%s), language(%s)", text, (parameter->language) ? parameter->language : "NULL");
+       return __request_add_text_with_synthesis_parameter(client, text, parameter, utt_id);
+}
+
 int tts_core_play(tts_client_s* client)
 {
        RETVM_IF(false == tts_client_is_valid_client(client), TTS_ERROR_INVALID_PARAMETER, "[ERROR] Client is invalid.");
index bdd5393..24da3a5 100644 (file)
@@ -52,6 +52,7 @@ int tts_core_foreach_supported_voices(tts_client_s* client, const char* engine_i
 // called by tts_ipc
 int tts_core_add_text(tts_client_s* client, const char* text, const char* language, int voice_type, int speed, int* utt_id);
 int tts_core_add_silent_utterance(tts_client_s* client, unsigned int duration_in_msec, int* utt_id);
+int tts_core_add_text_with_synthesis_parameter(tts_client_s* client, const char* text, tts_synthesis_parameter_h parameter, int* utt_id);
 int tts_core_play(tts_client_s* client);
 int tts_core_stop(tts_client_s* client);
 int tts_core_pause(tts_client_s* client);
index 539a206..7dd6d00 100644 (file)
@@ -807,6 +807,53 @@ int tts_dbus_request_add_silent_utterance(unsigned int uid, unsigned int duratio
        return result;
 }
 
+int tts_dbus_request_add_text_with_synthesis_parameter(unsigned int uid, const char* text, tts_synthesis_parameter_h parameter, int uttid, const char* credential)
+{
+       if (NULL == text || NULL == parameter) {
+               SLOG(LOG_ERROR, TAG_TTSC, "Input parameter is NULL");
+               return TTS_ERROR_INVALID_PARAMETER;
+       }
+
+       DBusMessage* msg = __tts_dbus_make_message(uid, TTS_METHOD_ADD_TEXT_WITH_SYNTHESIS_PARAMETER);
+       if (NULL == msg) {
+               SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request tts add text with systhesis parameter : Fail to make message");
+               return TTS_ERROR_OPERATION_FAILED;
+       } else {
+               SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request tts add text : uid(%u), text(%s), lang(%s), id(%d), credential(%s)",
+                        uid, text, parameter->language, uttid, (NULL == credential) ? "NULL" : credential);
+       }
+
+       char *temp = NULL;
+       if (NULL == credential) {
+               temp = strdup("NULL");
+       } else {
+               temp = strdup(credential);
+       }
+
+       if (true != dbus_message_append_args(msg,
+               DBUS_TYPE_UINT32, &uid,
+               DBUS_TYPE_STRING, &text,
+               DBUS_TYPE_STRUCT, &parameter,
+               DBUS_TYPE_INT32, &uttid,
+               DBUS_TYPE_STRING, &temp,
+               DBUS_TYPE_INVALID)) {
+               dbus_message_unref(msg);
+               SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to append args");
+
+               if (NULL != temp) {
+                       free(temp);
+                       temp = NULL;
+               }
+               return TTS_ERROR_OPERATION_FAILED;
+       }
+
+       int result = __send_message_and_get_result(msg, TTS_METHOD_ADD_TEXT_WITH_SYNTHESIS_PARAMETER);
+       if (NULL != temp) {
+               free(temp);
+               temp = NULL;
+       }
+       return result;
+}
 
 int tts_dbus_request_set_private_data(unsigned int uid, const char* key, const char* data)
 {
index 54395e9..8fd1535 100644 (file)
@@ -40,6 +40,8 @@ int tts_dbus_request_add_text(unsigned int uid, const char* text, const char* la
 
 int tts_dbus_request_add_silent_utterance(unsigned int uid, unsigned int duration_in_msec, int uttid, const char* credential);
 
+int tts_dbus_request_add_text_with_synthesis_parameter(unsigned int uid, const char* text, tts_synthesis_parameter_h parameter, int uttid, const char* credential);
+
 int tts_dbus_request_play(unsigned int uid, const char* credential);
 
 int tts_dbus_request_stop(unsigned int uid);
index cd83156..246399d 100644 (file)
@@ -26,6 +26,7 @@ typedef enum {
        REQUEST_FINALIZE,
        REQUEST_ADD_TEXT,
        REQUEST_ADD_SILENT_UTTERANCE,
+       REQUEST_ADD_TEXT_WITH_SYNTHESIS_PARAMETER,
        REQUEST_PLAY,
        REQUEST_STOP,
        REQUEST_PAUSE,
@@ -40,14 +41,14 @@ typedef enum {
 
 static int(*ttsc_dbus_vtable[])() = { &tts_dbus_open_connection, &tts_dbus_close_connection, &tts_dbus_stop_listening,
                                                &tts_dbus_request_hello, &tts_dbus_request_hello_sync, &tts_dbus_request_initialize,
-                                               &tts_dbus_request_finalize, &tts_dbus_request_add_text, &tts_dbus_request_add_silent_utterance, &tts_dbus_request_play, &tts_dbus_request_stop,
+                                               &tts_dbus_request_finalize, &tts_dbus_request_add_text, &tts_dbus_request_add_silent_utterance, &tts_dbus_request_add_text_with_synthesis_parameter, &tts_dbus_request_play, &tts_dbus_request_stop,
                                                &tts_dbus_request_pause, &tts_dbus_request_set_private_data, &tts_dbus_request_get_private_data,
                                                &tts_dbus_request_play_pcm, &tts_dbus_request_stop_pcm, &tts_dbus_request_add_pcm,
                                                &tts_dbus_request_get_service_state };
 
 static int(*ttsc_tidl_vtable[])() = { &tts_tidl_open_connection, &tts_tidl_close_connection, &tts_tidl_stop_listening,
                                                &tts_tidl_request_hello, &tts_tidl_request_hello_sync, &tts_tidl_request_initialize,
-                                               &tts_tidl_request_finalize, &tts_tidl_request_add_text, &tts_tidl_request_add_silent_utterance, &tts_tidl_request_play, &tts_tidl_request_stop,
+                                               &tts_tidl_request_finalize, &tts_tidl_request_add_text, &tts_tidl_request_add_silent_utterance, &tts_tidl_request_add_text_with_synthesis_parameter, &tts_tidl_request_play, &tts_tidl_request_stop,
                                                &tts_tidl_request_pause, &tts_tidl_request_set_private_data, &tts_tidl_request_get_private_data,
                                                &tts_tidl_request_play_pcm, &tts_tidl_request_stop_pcm, &tts_tidl_request_add_pcm,
                                                &tts_tidl_request_get_service_state };
@@ -170,6 +171,16 @@ int tts_ipc_request_add_silent_utterance(unsigned int uid, unsigned int duration
        return g_vtable[REQUEST_ADD_SILENT_UTTERANCE](uid, duration_in_msec, uttid, credential);
 }
 
+int tts_ipc_request_add_text_with_synthesis_parameter(unsigned int uid, const char* text, tts_synthesis_parameter_h parameter, int uttid, const char* credential)
+{
+       SLOG(LOG_INFO, TAG_TTSC, "[IPC] tts_ipc_request_add_text_with_synthesis_parameter");
+
+       RETVM_IF(false == tts_client_is_valid_uid(uid), TTS_ERROR_INVALID_PARAMETER, "Fail to get tts_client with uid(%u)", uid);
+       RETVM_IF(NULL == g_vtable, TTS_ERROR_OPERATION_FAILED, "[ERROR] IPC method is not set");
+
+       return g_vtable[REQUEST_ADD_TEXT_WITH_SYNTHESIS_PARAMETER](uid, text, parameter, uttid, credential);
+}
+
 int tts_ipc_request_set_private_data(unsigned int uid, const char* key, const char* data)
 {
        SLOG(LOG_INFO, TAG_TTSC, "[IPC] tts_ipc_request_set_private_data");
index 4612fcb..1c3d32a 100644 (file)
@@ -42,6 +42,8 @@ int tts_ipc_request_add_text(unsigned int uid, const char* text, const char* lan
 
 int tts_ipc_request_add_silent_utterance(unsigned int uid, unsigned int duration_in_msec, int uttid, const char* credential);
 
+int tts_ipc_request_add_text_with_synthesis_parameter(unsigned int uid, const char* text, tts_synthesis_parameter_h parameter, int uttid, const char* credential);
+
 int tts_ipc_request_play(unsigned int uid, const char* credential);
 
 int tts_ipc_request_stop(unsigned int uid);
index 97553a6..2de1746 100644 (file)
@@ -42,7 +42,7 @@ struct tts_s {
 * @brief A structure of handle for synthesis paramter
 */
 struct tts_synthesis_parameter_s {
-       char *langauge;
+       char *language;
        char *ptts_id;
        int voice_type;
        int speed;
index f0a6762..17ecfef 100644 (file)
@@ -686,6 +686,35 @@ int tts_tidl_request_add_silent_utterance(unsigned int uid, unsigned int duratio
        return TTS_ERROR_NONE;
 }
 
+int tts_tidl_request_add_text_with_synthesis_parameter(unsigned int uid, const char* text, tts_synthesis_parameter_h parameter, int uttid, const char* credential)
+{
+       SLOG(LOG_DEBUG, TAG_TTSC, "[TIDL] tts_tidl_request_add_text_with_synthesis_parameter");
+
+       tts_client_s* client = tts_client_get_by_uid(uid);
+       RETVM_IF(NULL == client, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Fail to get client");
+
+       tts_tidl_info_s* info = __get_tidl_info_s(uid);
+       RETVM_IF(NULL == info, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Fail to get tidl info");
+
+       RETVM_IF(NULL == text || NULL == parameter, TTS_ERROR_INVALID_PARAMETER, "Input parameter is NULL");
+
+       RETVM_IF(!info->connected, TTS_ERROR_IO_ERROR, "[ERROR] Not Connected");
+
+       const char *not_null_credential = NULL == credential ? "NULL" : credential;
+       int ret = rpc_port_proxy_tts_invoke_add_text_with_synthesis_parameter(info->rpc_h, uid, text, parameter->language, parameter->ptts_id, parameter->voice_type, parameter->speed, parameter->pitch, parameter->volume, parameter->background_volume_ratio, uttid, not_null_credential);
+       int exception = get_last_result();
+       if (RPC_PORT_ERROR_NONE != exception) {
+               ret = __convert_and_handle_tidl_error(exception, info);
+       }
+
+       if (TTS_ERROR_NONE != ret) {
+               SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request add text with synthesis parameter : Fail to invoke message");
+               return ret;
+       }
+
+       return TTS_ERROR_NONE;
+}
+
 int tts_tidl_request_set_private_data(unsigned int uid, const char* key, const char* data)
 {
        SLOG(LOG_DEBUG, TAG_TTSC, "[TIDL] tts_tidl_request_set_private_data");
index 14bd8b6..cb506df 100644 (file)
@@ -39,6 +39,8 @@ int tts_tidl_request_add_text(unsigned int uid, const char* text, const char* la
 
 int tts_tidl_request_add_silent_utterance(unsigned int uid, unsigned int duration_in_msec, int uttid, const char* credential);
 
+int tts_tidl_request_add_text_with_synthesis_parameter(unsigned int uid, const char* text, tts_synthesis_parameter_h parameter, int uttid, const char* credential);
+
 int tts_tidl_request_play(unsigned int uid, const char* credential);
 
 int tts_tidl_request_stop(unsigned int uid);
index 10d518d..18a300d 100644 (file)
@@ -75,6 +75,7 @@ extern "C" {
 #define TTS_METHOD_GET_CURRENT_VOICE   "tts_method_get_current_voice"
 #define TTS_METHOD_ADD_TEXT            "tts_method_add_text"
 #define TTS_METHOD_ADD_SILENT_UTTERANCE                "tts_method_add_silent_utterance"
+#define TTS_METHOD_ADD_TEXT_WITH_SYNTHESIS_PARAMETER           "tts_method_add_text_with_systhesis_parameter"
 #define TTS_METHOD_PLAY                        "tts_method_play"
 #define TTS_METHOD_STOP                        "tts_method_stop"
 #define TTS_METHOD_PAUSE               "tts_method_pause"
index c403ca3..65dc12b 100644 (file)
@@ -1,3 +1,13 @@
+struct tts_synthesis_parameter_s {
+       string langauge;
+       string ptts_id;
+       int voice_type;
+       int speed;
+       int pitch;
+       double volume;
+       double background_volume;
+}
+
 interface tts {
        void notify_cb(int pid, int uid, bundle msg) delegate;
        void register_cb(int pid, int uid, int mode, int playing_mode, int registered_event_mask, notify_cb callback) async;
@@ -7,6 +17,7 @@ interface tts {
        int finalize(in int uid);
        int add_text(int uid, string text, string lang, int vctype, int speed, int uttid, string credential);
        int add_silent_utterance(int uid, int duration_in_msec, int uttid, string credential);
+       int add_text_with_synthesis_parameter(int uid, string text, in string langauge, in string ptts_id, in int voice_type, in int speed, in int pitch, in double volume, in double background_volume, int uttid, string credential);
        int stop(in int uid);
        int pause(in int uid);
        int play_pcm(in int uid);