speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH 1/1] add voice set consistency check in modules


From: Andrei Kholodnyi
Subject: [PATCH 1/1] add voice set consistency check in modules
Date: Fri, 5 Nov 2010 10:03:38 +0100

when synthesis voice is set to NULL and voice stays unmodified we need
to set voice again since it was previously set to synthesis_voice

do not send voice=NULL to modules anymore, 
now it supports SPDVoice values only
---
 src/modules/module_utils.c |    7 +++++++
 src/server/output.c        |    2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/modules/module_utils.c b/src/modules/module_utils.c
index 05fb244..091c819 100644
--- a/src/modules/module_utils.c
+++ b/src/modules/module_utils.c
@@ -84,6 +84,13 @@ do_message(EMessageType msgtype)
        return g_strdup("301 ERROR CANT SPEAK");
     }
 
+    /* check voice and synthesis_voice settings for consistency */
+    if (msg_settings.synthesis_voice == NULL
+        && msg_settings_old.synthesis_voice != NULL
+        && msg_settings.voice == msg_settings_old.voice) {
+        /* force to set voice again, since synthesis_voice changed to NULL */
+       msg_settings_old.voice = -1;
+    }
     ret = module_speak(msg->str, strlen(msg->str), msgtype);
 
     g_string_free(msg,1);
diff --git a/src/server/output.c b/src/server/output.c
index bf89aa6..66b77a7 100644
--- a/src/server/output.c
+++ b/src/server/output.c
@@ -392,8 +392,6 @@ output_list_voices(char* module_name)
     val = fconv(msg->settings.name); \
     if (val != NULL){ \
        g_string_append_printf(set_str, #name"=%s\n", val); \
-    }else{ \
-       g_string_append_printf(set_str, #name"=NULL\n"); \
     } \
     g_free(val);
 
-- 
1.7.0.4




reply via email to

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