I was playing around with changing the voice gender like this:
…
recognizer.setVoiceGender(FEMALE_VOICE);
recognizer.say(“I love you very much”); // Speak a sentence
recognizer.setVoiceGender(MALE_VOICE);
recognizer.say(“I love you too”); // Speak a sentence
…
It didn’t work: it speaks both sentences as FEMALE.
Then I added a delay after the first ‘say’ instruction like this:
…
recognizer.setVoiceGender(FEMALE_VOICE);
recognizer.say(“I love you very much”); // Speak a sentence
delay(1000); // THIS DELAY IS REQUIRED TO SWITCH VOICE GENDER
recognizer.setVoiceGender(MALE_VOICE);
recognizer.say(“I love you too”); // Speak a sentence
…
That works: it speaks the first sentence, changes voice gender and speaks the second sentence. Which made me realize that the operating environment may be enhanced by adding creating an interrupt when the ‘say’ operation is complete. Then the software won’t have to guess how long to ‘delay’ (it’s never good to hard-code a delay inline).
Anyway, this is the Most Awesome Arduino add-on ever! It is VERY SLICK!
Thanks.