#include <string.h>#include <malloc.h>#include <espeak/speak_lib.h>espeak_POSITION_TYPEposition_type;espeak_AUDIO_OUTPUToutput;char*path=NULL;intBuflength=1000,Options=0;void*user_data;t_espeak_callback*SynthCallback;espeak_PARAMETERParm;charVoice[]={"English"};chartext[30]={"this is a english test"};unsignedintSize,position=0,end_position=0,flags=espeakCHARS_AUTO,*unique_identifier;intmain(intargc,char*argv[]){output=AUDIO_OUTPUT_PLAYBACK;intI,Run=1,L;espeak_Initialize(output,Buflength,path,Options);espeak_SetVoiceByName(Voice);constchar*langNativeString="en";//DefaulttoUSEnglishespeak_VOICEvoice;memset(&voice,0,sizeof(espeak_VOICE));//Zerooutthevoicefirstvoice.languages=langNativeString;voice.name="US";voice.variant=2;voice.gender=1;espeak_SetVoiceByProperties(&voice);Size=strlen(text)+1;espeak_Synth(text,Size,position,position_type,end_position,flags,unique_identifier,user_data);espeak_Synchronize();return0;}
I only want the espeak reads my strings in my program, and the above code can do it, but I want to know, are all of this code necessary for that purpose? (I mean is it possible to simplifying it?)
***Also I like to know are there a way to using espeak as a system function? I mean system("espeak "something" "); ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found this code on the internet:
I only want the
espeakreads my strings in my program, and the above code can do it, but I want to know, are all of this code necessary for that purpose? (I mean is it possible to simplifying it?)***Also I like to know are there a way to using
espeakas a system function? I meansystem("espeak "something" ");?