speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 02/09] replace ibmtts_voice_enum_to_str with spd_voice2str


From: Andrei Kholodnyi
Subject: [PATCH 02/09] replace ibmtts_voice_enum_to_str with spd_voice2str
Date: Fri, 1 Oct 2010 23:50:57 +0200

ibmtts_voice_enum_to_str duplicates spd_voice2str, removed
---
 src/modules/ibmtts.c |   24 ++----------------------
 1 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/src/modules/ibmtts.c b/src/modules/ibmtts.c
index 01faed9..e51a5c2 100644
--- a/src/modules/ibmtts.c
+++ b/src/modules/ibmtts.c
@@ -61,6 +61,7 @@
 /* Speech Dispatcher includes. */
 #include "spd_audio.h"
 #include <speechd_types.h>
+#include "spd_utils.h"
 #include "module_utils.h"
 
 #if HAVE_SNDFILE
@@ -250,7 +251,6 @@ static int *ibmtts_voice_index = NULL;
 /* Internal function prototypes for main thread. */
 static void ibmtts_set_language(char *lang);
 static void ibmtts_set_voice(EVoiceType voice);
-static char* ibmtts_voice_enum_to_str(EVoiceType voice);
 static void ibmtts_set_language_and_voice(char *lang, EVoiceType voice, char* 
dialect);
 static void ibmtts_set_synthesis_voice(char *);
 static void ibmtts_set_rate(signed int rate);
@@ -1116,32 +1116,12 @@ ibmtts_set_punctuation_mode(EPunctMode punct_mode)
     }
 }
 
-static char*
-ibmtts_voice_enum_to_str(EVoiceType voice)
-{
-    /* TODO: Would be better to move this to module_utils.c. */
-    char *voicename;
-    switch (voice) {
-        case NO_VOICE:      voicename = g_strdup("no voice");     break;
-        case MALE1:         voicename = g_strdup("male1");        break;
-        case MALE2:         voicename = g_strdup("male2");        break;
-        case MALE3:         voicename = g_strdup("male3");        break;
-        case FEMALE1:       voicename = g_strdup("female1");      break;
-        case FEMALE2:       voicename = g_strdup("female2");      break;
-        case FEMALE3:       voicename = g_strdup("female3");      break;
-        case CHILD_MALE:    voicename = g_strdup("child_male");   break;
-        case CHILD_FEMALE:  voicename = g_strdup("child_female"); break;
-        default:            voicename = g_strdup("no voice");     break;
-    }
-    return voicename;
-}
-
 /* Given a language, dialect and SD voice codes sets the IBM voice */
 static void
 ibmtts_set_language_and_voice(char *lang, EVoiceType voice, char* dialect)
 {
     char *dialect_name = dialect;
-    char *voicename = ibmtts_voice_enum_to_str(voice);
+    char *voicename = spd_voice2str(voice);
     int eciVoice;
     int ret = -1;
     int i = 0;
-- 
1.6.0.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]