[ITC][TTS][ACR-1862] TCs added for new APIs 77/318477/3
authorshobhitv <shobhit.v@samsung.com>
Mon, 30 Sep 2024 09:43:52 +0000 (15:13 +0530)
committershobhit verma <shobhit.v@samsung.com>
Mon, 30 Sep 2024 09:48:22 +0000 (09:48 +0000)
Change-Id: I61be7a14b9c54ff8c7a392060fa34cdde151fdab
Signed-off-by: shobhitv <shobhit.v@samsung.com>
src/itc/tts/ITs-tts.c
src/itc/tts/ITs-ttse.c
src/itc/tts/tct-tts-native_mobile.h
src/itc/tts/tct-tts-native_tizeniot.h
src/itc/tts/tct-tts-native_tv.h
src/itc/tts/tct-tts-native_wearable.h

index c9ba2084ff9f4817682ed62307baaf6297735d3a..2b8c0e18de40b8e4976752a9ad1b7d51d78d4423 100644 (file)
@@ -63,6 +63,12 @@ static void TTs_synthesized_pcm_cb(tts_h tts, int utt_id, tts_synthesized_pcm_ev
        FPRINTF("[Line: %d][%s] TTs_synthesized_pcm_cb callback invoked\\n", __LINE__, API_NAMESPACE);
 }
 
+static bool TtsSupportedPersonalVoice(tts_h tts, const char* language, const char* unique_id, const char* display_name, const char* device_name, void* user_data)
+{
+       FPRINTF("[Line: %d][%s] TtsSupportedPersonalVoice callback invoked\\n", __LINE__, API_NAMESPACE);
+       FPRINTF("[Line: %d][%s] language: %s, unique id: %s, display_name: %s, device_name: %s\\n", __LINE__, API_NAMESPACE, language, unique_id, display_name, device_name);
+       return true;
+}
 /**
 * @function            ITs_tts_startup
 * @description         Called before each test, created tts handle
@@ -2300,5 +2306,37 @@ int ITc_tts_add_text_with_synthesis_parameter_p(void)
 
        return 0;
 }
+
+//& purpose: Get each supported personal voices of the current engine
+/**
+* @testcase                            ITc_tts_foreach_supported_personal_voices_p
+* @since_tizen                                 9.0
+* @author                      SRID(shobhit.v)
+* @reviewer                    SRID(utk.tiwari)
+* @type                                        auto
+* @scenario                                    Get each supported personal voices of the current engine
+* @apicovered                          tts_foreach_supported_personal_voices
+* @passcase                                    if tts_foreach_supported_personal_voices is successful
+* @failcase                                    if tts_foreach_supported_personal_voices is not successful
+* @precondition                                NA
+* @postcondition                       NA
+*/
+int ITc_tts_foreach_supported_personal_voices_p(void)
+{
+       START_TEST;
+       int nRet = TTS_ERROR_NONE;
+
+       if (g_bFeatureSupported == false)
+       {
+               nRet = tts_foreach_supported_personal_voices(g_pstTts, TtsSupportedPersonalVoice, NULL);
+               PRINT_RESULT(TTS_ERROR_NOT_SUPPORTED, nRet, "tts_foreach_supported_personal_voices", TtsGetError(nRet));
+               return 0;
+       }
+
+       nRet = tts_foreach_supported_personal_voices(g_pstTts, TtsSupportedPersonalVoice, NULL);
+       PRINT_RESULT(TTS_ERROR_NONE, nRet, "tts_foreach_supported_personal_voices", TtsGetError(nRet));
+
+       return 0;
+}
 /** @} */
 /** @} */
index abfeb787ba4982169fd7eeda4eac2d47b7abc9c9..2dc310b4929a99183c2e37bfa037310e545e5e63 100644 (file)
@@ -115,6 +115,12 @@ static void TTSEActivatedModeChangedCB(int activated_mode)
        FPRINTF("[Line : %d][%s] TTSEActivatedModeChangedCB callback invoked. Activated mode is [%d]\\n", __LINE__, API_NAMESPACE, activated_mode);
        return;
 }
+
+static int tts_engine_send_personal_voice(const char* ptts_id, void* user_data)
+{
+       FPRINTF("[Line : %d][%s] tts_engine_send_personal_voice callback invoked. \\n", __LINE__, API_NAMESPACE);
+       return 0;
+}
 /**
 * @function            ITs_ttse_startup
 * @description         Called before each test
@@ -418,5 +424,59 @@ int ITc_ttse_get_activated_mode_p(void)
        PRINT_RESULT(TTSE_ERROR_NONE, nRet, "ttse_get_activated_mode", TtseGetError(nRet));
        return 0;
 }
+
+/**
+* @testcase                            ITc_ttse_send_personal_voice_p
+* @since_tizen                 9.0
+* @author              SRID(shobhit.v)
+* @reviewer            SRID(utk.tiwari)
+* @type                                auto
+* @description                 Sends the personal voice's information to the engine service user
+* @scenario                            call ttse_send_personal_voice to send personal voice's information to the engine service user
+* @apicovered                  ttse_send_personal_voice
+* @passcase                            If ttse_send_personal_voice api gets pass
+* @failcase                            If ttse_send_personal_voice api gets fail
+* @precondition                        NA
+* @postcondition               NA
+*/
+int ITc_ttse_send_personal_voice_p(void)
+{
+       START_TEST_TTSE;
+
+       int nRet = ttse_main(g_argc, g_argv, &g_tts_engine_callback);
+       PRINT_RESULT(TTSE_ERROR_NONE, nRet, "ttse_main", TtseGetError(nRet));
+
+       nRet = ttse_send_personal_voice("ko_KR", "id", "1234", "5678");
+       PRINT_RESULT(TTSE_ERROR_NONE, nRet, "ttse_send_personal_voice", TtseGetError(nRet));
+
+       return 0;
+}
+
+/**
+* @testcase                            ITc_ttse_set_personal_tts_id_set_cb_p
+* @since_tizen                 9.0
+* @author              SRID(shobhit.v)
+* @reviewer            SRID(utk.tiwari)
+* @type                                auto
+* @description                 Sets a callback function to be called when a personal TTS id is set
+* @scenario                            call ttse_set_personal_tts_id_set_cb to set callback function to be called when a personal TTS id is set
+* @apicovered                  ttse_set_personal_tts_id_set_cb
+* @passcase                            If ttse_set_personal_tts_id_set_cb api gets pass
+* @failcase                            If ttse_set_personal_tts_id_set_cb api gets fail
+* @precondition                        NA
+* @postcondition               NA
+*/
+int ITc_ttse_set_personal_tts_id_set_cb_p(void)
+{
+       START_TEST_TTSE;
+
+       int nRet = ttse_main(g_argc, g_argv, &g_tts_engine_callback);
+       PRINT_RESULT(TTSE_ERROR_NONE, nRet, "ttse_main", TtseGetError(nRet));
+
+       nRet = ttse_set_personal_tts_id_set_cb(tts_engine_send_personal_voice, NULL);
+       PRINT_RESULT(TTSE_ERROR_NONE, nRet, "ttse_set_personal_tts_id_set_cb", TtseGetError(nRet));
+
+       return 0;
+}
 /** @} */
 /** @} */
index cb473436c74c125e7bab426c5c19f1a41f7958f8..279c5652dcf749aa85084c908a50ec0384c86721 100644 (file)
@@ -66,6 +66,9 @@ extern int ITc_tts_synthesis_parameter_set_speed_set_pitch_p(void);
 extern int ITc_tts_synthesis_parameter_set_volume_background_ratio_p(void);
 extern int ITc_tts_get_pitch_volume_range_p(void);
 extern int ITc_tts_add_text_with_synthesis_parameter_p(void);
+extern int ITc_tts_foreach_supported_personal_voices_p(void);
+extern int ITc_ttse_send_personal_voice_p(void);
+extern int ITc_ttse_set_personal_tts_id_set_cb_p(void);
 
 testcase tc_array[] = {
        {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup},
@@ -110,6 +113,9 @@ testcase tc_array[] = {
        {"ITc_tts_add_silence_utterance_p",ITc_tts_add_silence_utterance_p,ITs_tts_startup,ITs_tts_cleanup},
        {"ITc_tts_add_text_with_synthesis_parameter_p",ITc_tts_add_text_with_synthesis_parameter_p,ITs_tts_startup,ITs_tts_cleanup},
        {"ITc_tts_get_pitch_volume_range_p",ITc_tts_get_pitch_volume_range_p,ITs_tts_startup,ITs_tts_cleanup},
+       {"ITc_tts_foreach_supported_personal_voices_p",ITc_tts_foreach_supported_personal_voices_p,ITs_tts_startup,ITs_tts_cleanup},
+       {"ITc_ttse_send_personal_voice_p",ITc_ttse_send_personal_voice_p,ITs_ttse_startup,ITs_ttse_cleanup},
+       {"ITc_ttse_set_personal_tts_id_set_cb_p",ITc_ttse_set_personal_tts_id_set_cb_p,ITs_ttse_startup,ITs_ttse_cleanup},
        {NULL, NULL}
 };
 
index c46caacfc25045938ea7aeee758287b01dae03da..80d459e396ded539c9f0ff1ad89bb1238bc2da09 100644 (file)
@@ -65,6 +65,9 @@ extern int ITc_tts_synthesis_parameter_set_speed_set_pitch_p(void);
 extern int ITc_tts_synthesis_parameter_set_volume_background_ratio_p(void);
 extern int ITc_tts_get_pitch_volume_range_p(void);
 extern int ITc_tts_add_text_with_synthesis_parameter_p(void);
+extern int ITc_tts_foreach_supported_personal_voices_p(void);
+extern int ITc_ttse_send_personal_voice_p(void);
+extern int ITc_ttse_set_personal_tts_id_set_cb_p(void);
 
 testcase tc_array[] = {
        {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup},
@@ -108,6 +111,9 @@ testcase tc_array[] = {
        {"ITc_tts_add_silence_utterance_p",ITc_tts_add_silence_utterance_p,ITs_tts_startup,ITs_tts_cleanup},
        {"ITc_tts_add_text_with_synthesis_parameter_p",ITc_tts_add_text_with_synthesis_parameter_p,ITs_tts_startup,ITs_tts_cleanup},
        {"ITc_tts_get_pitch_volume_range_p",ITc_tts_get_pitch_volume_range_p,ITs_tts_startup,ITs_tts_cleanup},
+       {"ITc_tts_foreach_supported_personal_voices_p",ITc_tts_foreach_supported_personal_voices_p,ITs_tts_startup,ITs_tts_cleanup},
+       {"ITc_ttse_send_personal_voice_p",ITc_ttse_send_personal_voice_p,ITs_ttse_startup,ITs_ttse_cleanup},
+       {"ITc_ttse_set_personal_tts_id_set_cb_p",ITc_ttse_set_personal_tts_id_set_cb_p,ITs_ttse_startup,ITs_ttse_cleanup},
        {NULL, NULL}
 };
 
index 2d8858481cac8594e01171b6605209badc2c13be..693ac58697c2a7ce44e5c560b06b5c640aa2328a 100644 (file)
@@ -58,6 +58,8 @@ extern int ITc_tts_synthesis_parameter_set_speed_set_pitch_p(void);
 extern int ITc_tts_synthesis_parameter_set_volume_background_ratio_p(void);
 extern int ITc_tts_get_pitch_volume_range_p(void);
 extern int ITc_tts_add_text_with_synthesis_parameter_p(void);
+extern int ITc_tts_foreach_supported_personal_voices_p(void);
+
 
 testcase tc_array[] = {
        {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup},
@@ -94,6 +96,7 @@ testcase tc_array[] = {
        {"ITc_tts_add_silence_utterance_p",ITc_tts_add_silence_utterance_p,ITs_tts_startup,ITs_tts_cleanup},
        {"ITc_tts_add_text_with_synthesis_parameter_p",ITc_tts_add_text_with_synthesis_parameter_p,ITs_tts_startup,ITs_tts_cleanup},
        {"ITc_tts_get_pitch_volume_range_p",ITc_tts_get_pitch_volume_range_p,ITs_tts_startup,ITs_tts_cleanup},
+       {"ITc_tts_foreach_supported_personal_voices_p",ITc_tts_foreach_supported_personal_voices_p,ITs_tts_startup,ITs_tts_cleanup},
        {NULL, NULL}
 };
 
index cb473436c74c125e7bab426c5c19f1a41f7958f8..279c5652dcf749aa85084c908a50ec0384c86721 100644 (file)
@@ -66,6 +66,9 @@ extern int ITc_tts_synthesis_parameter_set_speed_set_pitch_p(void);
 extern int ITc_tts_synthesis_parameter_set_volume_background_ratio_p(void);
 extern int ITc_tts_get_pitch_volume_range_p(void);
 extern int ITc_tts_add_text_with_synthesis_parameter_p(void);
+extern int ITc_tts_foreach_supported_personal_voices_p(void);
+extern int ITc_ttse_send_personal_voice_p(void);
+extern int ITc_ttse_set_personal_tts_id_set_cb_p(void);
 
 testcase tc_array[] = {
        {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup},
@@ -110,6 +113,9 @@ testcase tc_array[] = {
        {"ITc_tts_add_silence_utterance_p",ITc_tts_add_silence_utterance_p,ITs_tts_startup,ITs_tts_cleanup},
        {"ITc_tts_add_text_with_synthesis_parameter_p",ITc_tts_add_text_with_synthesis_parameter_p,ITs_tts_startup,ITs_tts_cleanup},
        {"ITc_tts_get_pitch_volume_range_p",ITc_tts_get_pitch_volume_range_p,ITs_tts_startup,ITs_tts_cleanup},
+       {"ITc_tts_foreach_supported_personal_voices_p",ITc_tts_foreach_supported_personal_voices_p,ITs_tts_startup,ITs_tts_cleanup},
+       {"ITc_ttse_send_personal_voice_p",ITc_ttse_send_personal_voice_p,ITs_ttse_startup,ITs_ttse_cleanup},
+       {"ITc_ttse_set_personal_tts_id_set_cb_p",ITc_ttse_set_personal_tts_id_set_cb_p,ITs_ttse_startup,ITs_ttse_cleanup},
        {NULL, NULL}
 };