if 0 { [Brian Theado] - 21Oct03 I have been reading Win Wenger's fascinating ''Einstein Factor'' [http://www.amazon.com/exec/obidos/tg/detail/-/076150186X/qid=1066784962]. This book is full of fascinating creativity and problem solving techniques. The author's website (http://winwenger.com) contains dozens and dozens of articles about topics similar that found in the ''Einstein Factor'' (http://winwenger.com/winsight.htm is a good starting point). One article [http://www.winwenger.com/part27.htm] gives details for a Babble-Back Machine in which two reel-to-reel tape recorders are rigged together to record and then play back the same sound with a few seconds delay. Read http://www.winwenger.com/feed1.htm for more details on learning from feedback from your own output. I decided the power of the [snack] sound extension would make implementing a similar device in Tcl easy. Below is the resulting code. It plays back all sound received on a computer's microphone with a 2 second delay. The delay can be changed to 1 second (for example) by hitting F2 to bring up the console and typing 'set delay 1000'. The units for the delay variable is in microseconds. I introduced this program to my 2 year old daughter and she is utterly thrilled with it. She laughed, squealed, talked and babbled for over an hour and a half and still wanted more. I have packaged this code along with snack together into a Windows starpack at http://tkoutline.sourceforge.net/babbleback.exe. [Brian Theado] - Update 23Oct03 - I ran this on a computer that has a very small amount of RAM (32MB) and found out that there are memory leaks. After about 15 minutes it would crash due to exhausted memory. This may be a bug in [snack]? I found that if I destroy the sound in the next event loop (using the "after 0" below) instead of in the play completion callback, then the memory doesn't leak. Also on this older computer, I've found that the echo effect (from the microphone picking up sound from the speaker) is more annoying as is the static sound and I've found it harder to get the output volume adjusted so you can still hear it, but it doesn't enter a feedback loop. } package require Tk package require sound proc play s { $s stop $s play -command "after 0 $s destroy" record } proc record {} { set s [snack::sound] $s record after $::delay "play $s" } proc createGui {} { wm title . "The Babbleback Machine" pack [label .label -text "Speak into the microphone"] pack [button .exit -text Exit -command exit] -fill both bind . "console show" } set delay 2000 if {$argc == 1} {set delay [lindex $argv 0]} createGui record