Fix issue that failed to call synthesis parameter api over TIDL 17/313717/5
authorsungwook79.park <sungwook79.park@samsung.com>
Mon, 1 Jul 2024 07:08:37 +0000 (16:08 +0900)
committersooyeon <sooyeon.kim@samsung.com>
Thu, 18 Jul 2024 00:54:40 +0000 (09:54 +0900)
Change-Id: I9076ebf0333526f8083014b99b2f0aedd717c757
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
client/tts.c
client/tts_tidl.c
server/ttsd_data.cpp
server/ttsd_engine_agent.c
server/ttsd_main.h
tidl/tts.tidl

index 2abfb55702c64de3e1dac8de2def9cbf8b2aee2e..85938dc7082743ed2addb4cb27f21cdb77ed5924 100644 (file)
@@ -1574,7 +1574,7 @@ int tts_synthesis_parameter_set_volume(tts_synthesis_parameter_h parameter, doub
        RETV_IF(TTS_ERROR_NONE != __tts_get_feature_enabled(), TTS_ERROR_NOT_SUPPORTED);
 
        RETVM_IF(NULL == parameter, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input handle is null");
-       RETVM_IF(0.0 > volume || 1.0 < volume, TTS_ERROR_INVALID_PARAMETER, "[ERROR] volume value(%f) is invalid.", volume);
+       RETVM_IF(0.0 > volume || 100.0 < volume, TTS_ERROR_INVALID_PARAMETER, "[ERROR] volume value(%f) is invalid.", volume);
 
        parameter->volume = volume;
 
index b5501179836caf6c49936e5b32cc772cf7784a97..ccbcf9e3ed01adbe3fe03990aa0e536bc72fce5d 100644 (file)
@@ -755,7 +755,23 @@ int tts_tidl_request_add_text_with_synthesis_parameter(unsigned int uid, const c
        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);
+
+       char *language = (parameter->language) ? (parameter->language) : "default";
+       char *ptts_id = (parameter->ptts_id) ? (parameter->ptts_id) : "#NULL";
+
+
+       SLOG(LOG_DEBUG, TAG_TTSC, "info->rpc_h (%p)", info->rpc_h);
+       SLOG(LOG_DEBUG, TAG_TTSC, "uid (%d)", uid);
+       SLOG(LOG_DEBUG, TAG_TTSC, "text(%s)", text);
+       SLOG(LOG_DEBUG, TAG_TTSC, "parameter->language(%s), input language(%s)", (parameter->language) ? (parameter->language) : "null", language);
+       SLOG(LOG_DEBUG, TAG_TTSC, "parameter->ptts_id(%s), input ptts_id(%s)", (parameter->ptts_id) ? (parameter->ptts_id) : "null", ptts_id);
+       SLOG(LOG_DEBUG, TAG_TTSC, "parameter->voice_type (%d)", parameter->voice_type);
+       SLOG(LOG_DEBUG, TAG_TTSC, "parameter->speed (%d)", parameter->speed);
+       SLOG(LOG_DEBUG, TAG_TTSC, "parameter->pitch (%d)", parameter->pitch);
+       SLOG(LOG_DEBUG, TAG_TTSC, "parameter->volume (%f)", parameter->volume);
+       SLOG(LOG_DEBUG, TAG_TTSC, "parameter->background_volume_ratio (%f)", parameter->background_volume_ratio);
+
+       int ret = rpc_port_proxy_tts_invoke_add_text_with_synthesis_parameter(info->rpc_h, uid, text, language, 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);
index b12c314ec1079112f05ba35a569b6b97b241f285..2a8dfb6f65e8be8688f8b922dcc9344b7a421d98 100644 (file)
@@ -510,8 +510,8 @@ speak_data_s* ttsd_data_create_speak_data(const char* text, const char* language
 
        speak_data->synth_parameter.speed = speed;
        speak_data->synth_parameter.pitch = pitch;
-       speak_data->synth_parameter.volume = -1.0;
-       speak_data->synth_parameter.background_volume_ratio = -1.0;
+       speak_data->synth_parameter.volume = volume;
+       speak_data->synth_parameter.background_volume_ratio = background_volume_ratio;
 
        speak_data->utt_id = utt_id;
        speak_data->is_silent = is_silent;
index 92426e756c8ca0b72a32cd92fda192e1ee0d5a99..ba65fc1c1a278e36009cfc5232fe299c8827c49a 100644 (file)
@@ -191,6 +191,7 @@ static int __set_engine_callback(ttse_request_callback_s* callback, ttsengine_in
        engine_info->callbacks->private_data_set = NULL;
        engine_info->callbacks->private_data_requested = NULL;
        engine_info->callbacks->activated_mode_changed = NULL;
+       engine_info->callbacks->set_personal_tts_id = NULL;
 
        SLOG(LOG_DEBUG, tts_tag(), "--- Valid Engine ---");
        SLOG(LOG_DEBUG, tts_tag(), "Engine uuid : %s", engine_info->engine_uuid);
index 8d85c89d5a82e51edc4a5d54d693ac429eb0ed4a..7f80001cbbcf989baefdf174e02340b7827eefa0 100644 (file)
@@ -100,7 +100,6 @@ typedef struct {
        ttse_foreach_supported_voices_cb        foreach_voices;
        ttse_is_valid_voice_cb                  is_valid_voice;
        ttse_set_pitch_cb                       set_pitch;
-       ttse_set_personal_tts_id_cb             set_personal_tts_id;
 
        ttse_load_voice_cb                      load_voice;
        ttse_unload_voice_cb                    unload_voice;
@@ -113,6 +112,7 @@ typedef struct {
        ttse_private_data_set_cb                private_data_set;
        ttse_private_data_requested_cb          private_data_requested;
        ttse_activated_mode_changed_cb          activated_mode_changed;
+       ttse_set_personal_tts_id_cb             set_personal_tts_id;
 } tts_engine_callback_s;
 
 
index 65dc12b6965866e95a06710ef7f972fcc8142efa..607f4283b37c295663405bba8717240215a31faf 100644 (file)
@@ -17,7 +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 add_text_with_synthesis_parameter(int uid, string text, string langauge, string ptts_id, int voice_type, int speed, int pitch, double volume, double background_volume, int uttid, string credential);
        int stop(in int uid);
        int pause(in int uid);
        int play_pcm(in int uid);