I’m not so sure this fits in the “elegant code” theme, but it’s a “fun with code” topic that someone might enjoy. Especially if you have a little one.

My 4yr old is learning how to spell small and simple words like her name, “Mom”, “Dad”, etc, and continuing her exploration with letters on the keyboard. She’s been banging on a keyboard since her early years on babysmash. In fact I came home one day to find my monitor turned 90 degrees and about every possible admin window open in the background because of certain key combinations were not trapped by babysmash. But I digress…

For a while she was typing some text into notepad and asking me what it spelled.

“ajlkjwelsl” –> What’s that spell daddy?

I then thought it would be fun if the computer could give instant feedback about what she typed and in a matter of a minute or so I whipped up this little “game” which we had fun playing for a bit.

function Start-The-Fun()
{
	$voice = new-object -com SAPI.SpVoice;
	
	while($true)
	{
		write-host "->" -NoNewLine;
		$msg = read-host;
		$Voice.Speak( $msg, 1 ) | out-null;
	}
}

Just paste the function above as shown below and run it. Type some text (make sure your computer’s sound is on) and press enter to hear it.

image

I typed some of the usual things we say around the house and my 4yr old wouldn’t stop laughing…

Give it a try with your little ones (or big ones). Even let your non-techie significant other have a go – he/she may have some fun with it.

Previous post

Mapping an Address with the Bing Maps WPF Control (Beta)

Next post

Prism-fy the Bing Maps WPF Control (Beta)

7 Comments

  1. September 1, 2011 at 5:39 am

    I have had the same type of household hilarity using google translate with my daughters. 😉

  2. September 1, 2011 at 1:24 pm

    Alternatively you could hit the ‘voice’ button on http://translate.google.com (w/o translating)

    • September 1, 2011 at 2:13 pm

      Nice, I hadn’t noticed that. I took a few sample sentences and compared the voice translation of the google one VS the build in windows 7 voice and the win7 once seemed to pronounce things a little better.

      But thanks for the tip anyway.

  3. September 1, 2011 at 10:31 pm

    This is awesome.

  4. September 1, 2011 at 11:34 pm

    This is really great.  My kids love doing the same thing.  Can’t wait to get home and show them what Dad’s been up to at work.  (Gotta build that strong work ethic)  🙂

  5. September 2, 2011 at 11:34 am

    That’s great!  Did something similar with my 4 yr old and his friend and they were asking for all kinds of things to be said.  Lots of fun.

  6. September 29, 2011 at 8:22 pm

    I think the problem is that your pc is indeed 4 YEARS OLD!! you should goto buy a Gaming PC (a real computer) and ditch the kids computer.