Forum >Speech Synthesis shield DFR0273 - Arduino hangs after the first sentence pronounced
Speech Synthesis shield DFR0273 - Arduino hangs after the first sentence pronounced

Hello,
I have a big trouble with my Speech Synthesis shield on an Arduino Mega2560. I have checked the power source is powerful enough and memory available for the sketch is huge.
Here my speech definitions :
What is wrong ? Any idea ?
Best regards
I have a big trouble with my Speech Synthesis shield on an Arduino Mega2560. I have checked the power source is powerful enough and memory available for the sketch is huge.
Here my speech definitions :
Code: Select all
Here my speech function:
byte voiceJarvisArmor = 0; char volumeLevel5[] = "5\0"; char answerJarvis_defaultMode[] = "the armor is switched to default mode\0"; char answerJarvis_initCompleted[] = "the systems are initialized. the armor is fully functional\0";
Code: Select all
here the main loop and setup :
void ttsJarvisSays (byte voiceType, char ttsJarvisSentence[]) { byte ttsJarvisBuffer[500]; SpeechSynthesis.buf_init(ttsJarvisBuffer); SpeechSynthesis.English(ttsJarvisBuffer,4,volumeLevel5); SpeechSynthesis.English(ttsJarvisBuffer,6,ttsJarvisSentence); SpeechSynthesis.Espeaking(0,voiceType,4,ttsJarvisBuffer); while(Serial.read()!=0x41) {} while(Serial.read()!=0x4F) {} }
Code: Select all
The first sentence is properly pronounced, but nothing after "ttsJarvisSays (voiceJarvisArmor,answerJarvis_initCompleted);" is executed. The Arduino seems to be hanged.void setup(){ Serial.begin(9600); } void loop() { ttsJarvisSays (voiceJarvisArmor,answerJarvis_initCompleted); ttsJarvisSays (voiceJarvisArmor,answerJarvis_defaultMode); }
What is wrong ? Any idea ?
Best regards
2019-08-14 23:35:30 Hi,
Can you try commenting both
while(Serial.read()!=0x41)//waiting synthesis complete
{}
and
while(Serial.read()!=0x4F)//waiting play complete
{}
And then check the result. I checked libs that it seems that there is no 0x41 and 0x4f would be written in serial, which means it will be stuck in the while loop forever.
xuegangxiao117
Can you try commenting both
while(Serial.read()!=0x41)//waiting synthesis complete
{}
and
while(Serial.read()!=0x4F)//waiting play complete
{}
And then check the result. I checked libs that it seems that there is no 0x41 and 0x4f would be written in serial, which means it will be stuck in the while loop forever.

2019-08-13 03:21:27 Hi, I have the same problem:
this works (in setup)
infoatphp
this works (in setup)
Code: Select all
and this doesn't send the execute command (led remains on, and shield 'busy' led remains off)SpeechSynthesis.buf_init(ssr);//Clear the buffer SpeechSynthesis.English(ssr,4,"5");//volume in grade 5 SpeechSynthesis.English(ssr,6,"Booting up");//"6" means synthesis in English; "cooki"is the content SpeechSynthesis.Espeaking(0,16,4,ssr);//Executive commands above, "0" is synthesis command; "19" select speaker; "4" speech function while(Serial.read()!=0x41)//waiting synthesis complete {} while(Serial.read()!=0x4F)//waiting play complete {} SpeechSynthesis.English(ssr,4,"9");//volume in grade 9
Code: Select all
Found any solution? SpeechSynthesis.buf_init(ssr);//Clear the buffer SpeechSynthesis.English(ssr,4,"9");//volume in grade 9 SpeechSynthesis.English(ssr,6,"Okay");//"6" means synthesis in English; "cooki"is the content SpeechSynthesis.Espeaking(0,19,4,ssr);//Executive commands above, "0" is synthesis command; "19" select speaker; "4" speech function digitalWrite(LED, HIGH); while(Serial.read()!=0x41)//waiting synthesis complete {} digitalWrite(LED, LOW); while(Serial.read()!=0x4F)//waiting play complete {}
