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

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

userHead Account cancelled 2017-08-23 11:15:20 3075 Views3 Replies
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 :
Code: Select all
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";
Here my speech function:
Code: Select all
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)
{}
}
here the main loop and setup :
Code: Select all
void setup(){
Serial.begin(9600);
}
void loop() {
ttsJarvisSays (voiceJarvisArmor,answerJarvis_initCompleted);
ttsJarvisSays (voiceJarvisArmor,answerJarvis_defaultMode);
}
The first sentence is properly pronounced, but nothing after "ttsJarvisSays (voiceJarvisArmor,answerJarvis_initCompleted);" is executed. The Arduino seems to be hanged.

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.
userHeadPic xuegangxiao117
2019-08-13 03:21:27 Hi, I have the same problem:

this works (in setup)
Code: Select all
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
and this doesn't send the execute command (led remains on, and shield 'busy' led remains off)
Code: Select all
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
{}
Found any solution?
userHeadPic infoatphp