mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-21 21:28:08 +00:00
improve espeak command line invocation.
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@523 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
922cd8aa2d
commit
ba0d970b22
1 changed files with 9 additions and 2 deletions
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue