speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH 4/8] added pitch_range options to spd-say


From: Luke Yelavich
Subject: [PATCH 4/8] added pitch_range options to spd-say
Date: Fri, 24 Oct 2014 14:44:41 -0400

From: Hussain Jasim <address@hidden>
To: address@hidden

---
 src/clients/say/options.c | 10 +++++++++-
 src/clients/say/options.h |  4 +++-
 src/clients/say/say.c     |  5 +++++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/clients/say/options.c b/src/clients/say/options.c
index eb0714a..1fda529 100644
--- a/src/clients/say/options.c
+++ b/src/clients/say/options.c
@@ -54,6 +54,11 @@ void options_print_help(char *argv[])
        printf("\t\t\t\t");
        printf(_("(between %+d and %+d, default: %d)\n"), -100, 100, 0);
 
+       printf("-R, --pitch-range\t\t\t");
+       printf(_("Set the pitch range of the speech\n"));
+       printf("\t\t\t\t");
+       printf(_("(between %+d and %+d, default: %d)\n"), -100, 100, 0);
+       
        printf("-i, --volume\t\t\t");
        printf(_("Set the volume (intensity) of the speech\n"));
        printf("\t\t\t\t");
@@ -72,7 +77,7 @@ void options_print_help(char *argv[])
        printf(_("Set the language (ISO code)\n"));
 
        printf("-t, --voice-type\t\t");
-       printf(_("Set the preferred voice type\n"));
+       printf(_("Set the prefered voice type\n"));
        printf("\t\t\t\t(male1, male2, male3, female1, female2\n"
               "\t\t\t\tfemale3, child_male, child_female)\n");
 
@@ -194,6 +199,9 @@ int options_parse(int argc, char *argv[])
                case 'p':
                        OPT_SET_INT(pitch);
                        break;
+               case 'R':
+                       OPT_SET_INT(pitch_range);
+                       break;
                case 'i':
                        OPT_SET_INT(volume);
                        break;
diff --git a/src/clients/say/options.h b/src/clients/say/options.h
index 6996151..2ad1889 100644
--- a/src/clients/say/options.h
+++ b/src/clients/say/options.h
@@ -26,6 +26,7 @@
 
 signed int rate;
 signed int pitch;
+signed int pitch_range;
 signed int volume;
 
 int list_output_modules;
@@ -50,6 +51,7 @@ char *connection_name;
 static struct option long_options[] = {
        {"rate", 1, 0, 'r'},
        {"pitch", 1, 0, 'p'},
+       {"pitch-range", 1, 0, 'R'},
        {"volume", 1, 0, 'i'},
        {"output-module", 1, 0, 'o'},
        {"list-output-modules", no_argument, 0, 'O'},
@@ -73,7 +75,7 @@ static struct option long_options[] = {
        {0, 0, 0, 0}
 };
 
-static char *short_options = "r:p:i:l:o:OI:t:Ly:m:sxeP:N:n:wSCvh";
+static char *short_options = "r:p:R:i:l:o:OI:t:Ly:m:sxeP:N:n:wSCvh";
 
 int options_parse(int argc, char *argv[]);
 void options_print_version();
diff --git a/src/clients/say/say.c b/src/clients/say/say.c
index f92b845..c70a066 100644
--- a/src/clients/say/say.c
+++ b/src/clients/say/say.c
@@ -72,6 +72,7 @@ int main(int argc, char **argv)
 
        rate = -101;
        pitch = -101;
+       pitch_range = -101;
        volume = -101;
        language = NULL;
        voice_type = NULL;
@@ -203,6 +204,10 @@ int main(int argc, char **argv)
                if (spd_set_voice_pitch(conn, pitch))
                        printf("Invalid pitch!\n");
 
+       if (pitch_range != -101)
+               if (spd_set_voice_pitch_range(conn, pitch_range))
+                       printf("Invalid pitch range!\n");
+
        if (volume != -101)
                if (spd_set_volume(conn, volume))
                        printf("Invalid volume!\n");
-- 
2.1.0




reply via email to

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