This is a scratch'd version of a piece of code I'm writing for a robot. The robot roams around my house but if it hears two sharp claps or whistles, it stops, whistles back and then counts the number of claps/whistles to recieve a command. For example 1 whistle means return to charge station. You will need the Flash player for this. Clap or whistle loudly twice, the cat will whistle back if it hears you, then clap from one to four times to make the cat move! You can lower the threshold variable if the mic is not picking your claps up very well.