From ba0d970b22c1c1543fec32bb7d44f09e1d4dfe50 Mon Sep 17 00:00:00 2001 From: smorlat Date: Thu, 9 Jul 2009 11:19:39 +0000 Subject: [PATCH] improve espeak command line invocation. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@523 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/console/commands.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/linphone/console/commands.c b/linphone/console/commands.c index 1cd8f6378..a07f9d69b 100644 --- a/linphone/console/commands.c +++ b/linphone/console/commands.c @@ -1472,12 +1472,19 @@ static int lpc_cmd_speak(LinphoneCore *lc, char *args){ char cl[128]; char *wavfile; int status; + FILE *file; memset(voice,0,sizeof(voice)); sscanf(args,"%s63",voice); sentence=args+strlen(voice); wavfile=tempnam("/tmp/","linphonec-espeak-"); - snprintf(cl,sizeof(cl),"espeak -v %s -w %s \"%s\"",voice,wavfile,sentence); - status=system(cl); + snprintf(cl,sizeof(cl),"espeak -v %s -s 100 -w %s --stdin",voice,wavfile); + file=popen(cl,"w"); + if (file==NULL){ + ms_error("Could not open pipe to espeak !"); + return 1; + } + fprintf(file,"%s",sentence); + status=pclose(file); if (WEXITSTATUS(status)==0){ linphone_core_set_play_file(lc,wavfile); }else{