user8663682:
I am trying to pass 11 strings to espeak
and it says them one by one. but it gives me segmentation fault(core dumped)
error. This is my code:
#include
#include
#include
#include
#include
#include
int main()
{
espeak_POSITION_TYPE position_type;
espeak_AUDIO_OUTPUT output;
char *path=NULL;
int Buflength = 500, Options=0;
void* user_data;
t_espeak_callback *SynthCallback;
espeak_PARAMETER Parm;
char Voice[] = {"English"};
int i=0;
char text[11][200]{"hi there! welcome to xxx",
"This is xxx from xxx corporation",
"you can Talk with me very soon ",
"I am glad too meet you here "
"you can see many science and technology products here ",
"hope you find your interests soon ",
"come in and enjoy please! ",
"if you want find me later, search for xxx ",
"you will find me on the Internet ",
"I hope i can be your guest in future ",
"Take care, babye! "};
unsigned int Size,position=0, end_position=0, flags=espeakCHARS_AUTO, *unique_identifier;
output = AUDIO_OUTPUT_PLAYBACK;
espeak_Initialize(output, Buflength, path, Options );
espeak_SetVoiceByName(Voice);
const char *langNativeString = "en_US";
espeak_VOICE voice={0};
voice.languages = langNativeString;
voice.name = "US";
voice.variant = 2;
voice.gender = 1;
// Size = strlen(text)+1;
for (;;)
{
for(i=0; i{
Size = strlen(text[i])+1;
system("eog --fullscreen --disable-gallery --single-window 1.jpg &");
usleep(3000000);
espeak_Synth( text[i], Size, position, position_type, end_position, flags,
unique_identifier, user_data );
espeak_Synchronize( );
system("eog --fullscreen --disable-gallery --single-window 1.jpg &");
usleep(3000000);
}
}
return 0;
}
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE