Instructables

Animatronic Talking Tree - Part 2 - Speech Recognition

Featured
Picture of Animatronic Talking Tree - Part 2 - Speech Recognition
If you followed along with my first Instructable, Animatronic Talking Christmas Tree, I showed you how to take an artificial tree, add some servos and an Arduino, connect it to a Processing sketch running on your computer, and make him talk and animate.

Now I want to take you a through a few more steps so that you can turn your treebot into an interactive installation. I am not going to walk you through another motion-triggered,  pre-recorded animatronic. Nor am I going to expand on the remote controlling of the tree, I have already shown you some simple techniques for that (In the first Instructable). I am going to show you how to make your Processing sketch recognize verbal commands, and perform both some useful and useless (but entertaining) things. If you follow through successfully you will have made a your push-button-reactive robot into one that listens and responds to your voice, just as a good tree should.

Here's what the tree will do when finished.


 
Remove these adsRemove these ads by Signing Up

Step 1: Things that you will need

As this is a continuation of the Animatronic Talking Tree Instructable, you should already be in possesion of everything that you will need. For those who are just joining in, you will require
  • One Animatronic Christmas Tree, or suitably serial controlled animatronic. (Maybe you have made a talking teddy, or  grapefruit instead)
  • A computer running Processing, which you already have if you have completed makiing the first item on the list.

ali.al.7545702 months ago

Great instruction man , i was able to make my bot using this ... the "<address> do " structure is very clever , filters out unwanted behavior .

Thanks alot , i might develop this test into an AI project next semester :)

TsenoT3 months ago

The font of the code is disgusting, TOTALLY unreadable !!!!

Gieh1 year ago
I tried to export as application but it doesn't work.. :( help please
sshah182 years ago
Ok i got it, I was using lib folder instead of libraries .
sshah182 years ago
i created a new grammar file but when i change its name i get this error
Exception in thread "Animation Thread" java.lang.NullPointerException
at voce.SpeechRecognizer.getQueueSize(SpeechRecognizer.java:152)
at voce.SpeechInterface.getRecognizerQueueSize(SpeechInterface.java:149)
at My_voice.draw(My_voice.java:103)
at processing.core.PApplet.handleDraw(PApplet.java:2128)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:190)
at processing.core.PApplet.run(PApplet.java:2006)
at java.lang.Thread.run(Thread.java:662)
MovieMaker2 years ago
You did a really good job! I was wondering, since you have so many scripts and the arduino only accepts one at a time, which one is the Final One? I am not very good at understanding too well but would like to know.

Thanks,
fjordcarver (author)  MovieMaker2 years ago
Cheers!!
I broke the code up into chunks in an attempt to make each step clear. So I guess the final code would be once you have added all the features that you like? 
The arduino is only running some code that responds to serial input coming from processing. In this 'ible I am more showing how to get speech recognition running in processing and providing a few 'seed' ideas to put it to an entertaining use. Check out part 1 (link above), it might clarify things a little bit.
electricmic2 years ago
Terrific instructable thank you!
Do you have to train the robot to recognize your speech patterns or are the commands user independent ?
fjordcarver (author)  electricmic2 years ago
Thanks so much, glad that you enjoyed it. It is speech recognition not voice recognition, so it is not trained to my voice.
fjordcarver (author) 2 years ago
I SHOULD have just made it drop the f-bomb and regurgitate some naughtiness, I have two young children so I kept it clean. So much for innovation. A spray can and a lighter make for better reading, and some pre-recorded naughtiness is more interesting. live and learn.
sunshiine3 years ago
Like the update!
fjordcarver (author)  sunshiine3 years ago
Thanks!
mikeasaurus3 years ago
Time, weather and jokes?! Awesome!
(also, did the tree say "kiss me" at 0:50 in the first video?)
fjordcarver (author)  mikeasaurus3 years ago
yes, he did, cheeky fellow. He quips things when he hears a thank you or a Merry Christmas. Thanks!!
(I have a habit of thanking even machines when they have done something for me..so I programmed accordingly...it is not always easy being Canadian.)