Commit ba0d970b authored by smorlat's avatar smorlat
Browse files

improve espeak command line invocation.

git-svn-id: svn+ssh:// 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 922cd8aa
...@@ -1472,12 +1472,19 @@ static int lpc_cmd_speak(LinphoneCore *lc, char *args){ ...@@ -1472,12 +1472,19 @@ static int lpc_cmd_speak(LinphoneCore *lc, char *args){
char cl[128]; char cl[128];
char *wavfile; char *wavfile;
int status; int status;
FILE *file;
memset(voice,0,sizeof(voice)); memset(voice,0,sizeof(voice));
sscanf(args,"%s63",voice); sscanf(args,"%s63",voice);
sentence=args+strlen(voice); sentence=args+strlen(voice);
wavfile=tempnam("/tmp/","linphonec-espeak-"); wavfile=tempnam("/tmp/","linphonec-espeak-");
snprintf(cl,sizeof(cl),"espeak -v %s -w %s \"%s\"",voice,wavfile,sentence); snprintf(cl,sizeof(cl),"espeak -v %s -s 100 -w %s --stdin",voice,wavfile);
status=system(cl); file=popen(cl,"w");
if (file==NULL){
ms_error("Could not open pipe to espeak !");
return 1;
if (WEXITSTATUS(status)==0){ if (WEXITSTATUS(status)==0){
linphone_core_set_play_file(lc,wavfile); linphone_core_set_play_file(lc,wavfile);
}else{ }else{
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment