speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH 1/1] add --sound-icon parameter to the "say" client


From: Andrei Kholodnyi
Subject: [PATCH 1/1] add --sound-icon parameter to the "say" client
Date: Sat, 19 Nov 2011 15:32:27 +0100

add the posibility to play a sound icon with the "say" client
---
 doc/spd-say.texi          |    2 ++
 src/clients/say/options.c |    6 ++++++
 src/clients/say/options.h |    4 +++-
 src/clients/say/say.c     |    6 +++++-
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/doc/spd-say.texi b/doc/spd-say.texi
index db96fa5..735a04e 100644
--- a/doc/spd-say.texi
+++ b/doc/spd-say.texi
@@ -77,6 +77,8 @@ Set the volume (intensity) of the speech (between -100 and 
+100, default see bel
 Set the output module.  Default see below.
 @item -O or --list-output-modules
 List the output modules that are available with the current server.
+ at item -I or --sound-icon
+Play the sound icon.
 @item -l or --language
 Set the language. The parameter is an iso language code, like @code{en} or 
@code{cs}.
 Default see below.
diff --git a/src/clients/say/options.c b/src/clients/say/options.c
index cf9f408..5f0297d 100644
--- a/src/clients/say/options.c
+++ b/src/clients/say/options.c
@@ -65,6 +65,9 @@ void options_print_help(char *argv[])
        printf("-O, --list-output-modules\t");
        printf(_("Get the list of output modules\n"));
 
+       printf("-I, --sound-icon\t\t");
+       printf(_("Play the sound icon\n"));
+
        printf("-l, --language\t\t\t");
        printf(_("Set the language (ISO code)\n"));
 
@@ -202,6 +205,9 @@ int options_parse(int argc, char *argv[])
                case 'O':
                        list_output_modules = 1;
                        break;
+               case 'I':
+                       OPT_SET_STR(sound_icon);
+                       break;
                case 't':
                        OPT_SET_STR(voice_type);
                        break;
diff --git a/src/clients/say/options.h b/src/clients/say/options.h
index b7bd32e..6996151 100644
--- a/src/clients/say/options.h
+++ b/src/clients/say/options.h
@@ -30,6 +30,7 @@ signed int volume;
 
 int list_output_modules;
 char *output_module;
+char *sound_icon;
 char *language;
 char *voice_type;
 char *punctuation_mode;
@@ -52,6 +53,7 @@ static struct option long_options[] = {
        {"volume", 1, 0, 'i'},
        {"output-module", 1, 0, 'o'},
        {"list-output-modules", no_argument, 0, 'O'},
+       {"sound-icon", required_argument, 0, 'I'},
        {"language", 1, 0, 'l'},
        {"voice-type", 1, 0, 't'},
        {"list-synthesis-voices", no_argument, 0, 'L'},
@@ -71,7 +73,7 @@ static struct option long_options[] = {
        {0, 0, 0, 0}
 };
 
-static char *short_options = "r:p:i:l:o:Ot:Ly:m:sxeP:N:n:wSCvh";
+static char *short_options = "r:p: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 4ce1cd0..f92b845 100644
--- a/src/clients/say/say.c
+++ b/src/clients/say/say.c
@@ -94,7 +94,7 @@ int main(int argc, char **argv)
        /* Check if the text to say or options are specified in the argument */
        msg_arg_required = (pipe_mode != 1) && (stop_previous != 1)
            && (cancel_previous != 1) && (list_synthesis_voices != 1)
-           && (list_output_modules != 1);
+           && (list_output_modules != 1) && (sound_icon == NULL);
        if ((optind >= argc) && msg_arg_required) {
                options_print_help(argv);
                return 1;
@@ -248,6 +248,10 @@ int main(int argc, char **argv)
                }
        }
 
+       if (sound_icon != NULL)
+               if (spd_sound_icon(conn, spd_priority, sound_icon))
+                       printf("Invalid sound_icon!\n");
+
        if (wait_till_end) {
                ret = sem_init(&semaphore, 0, 0);
                if (ret < 0) {
-- 
1.7.5.4




reply via email to

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