From: sungwook79.park Date: Mon, 1 Jul 2024 07:08:37 +0000 (+0900) Subject: Fix issue that failed to call synthesis parameter api over TIDL X-Git-Tag: accepted/tizen/unified/20240724.120342~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91f02b40facfa5b79c08878b3b6ffedfcc8291aa;p=platform%2Fcore%2Fuifw%2Ftts.git Fix issue that failed to call synthesis parameter api over TIDL Change-Id: I9076ebf0333526f8083014b99b2f0aedd717c757 Signed-off-by: sungwook79.park --- diff --git a/client/tts.c b/client/tts.c index 2abfb557..85938dc7 100644 --- a/client/tts.c +++ b/client/tts.c @@ -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; diff --git a/client/tts_tidl.c b/client/tts_tidl.c index b5501179..ccbcf9e3 100644 --- a/client/tts_tidl.c +++ b/client/tts_tidl.c @@ -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); diff --git a/server/ttsd_data.cpp b/server/ttsd_data.cpp index b12c314e..2a8dfb6f 100644 --- a/server/ttsd_data.cpp +++ b/server/ttsd_data.cpp @@ -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; diff --git a/server/ttsd_engine_agent.c b/server/ttsd_engine_agent.c index 92426e75..ba65fc1c 100644 --- a/server/ttsd_engine_agent.c +++ b/server/ttsd_engine_agent.c @@ -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); diff --git a/server/ttsd_main.h b/server/ttsd_main.h index 8d85c89d..7f80001c 100644 --- a/server/ttsd_main.h +++ b/server/ttsd_main.h @@ -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; diff --git a/tidl/tts.tidl b/tidl/tts.tidl index 65dc12b6..607f4283 100644 --- a/tidl/tts.tidl +++ b/tidl/tts.tidl @@ -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);