Saturday, May 1, 2010

Skype as a whole-house Wireless Microphone for Home Automation

After buying a home (finally!) this past fall, I've been setting up a bunch of home automation capabilities. Recently I got far enough along that I started pondering how I might get a whole-house microphone system talking to my central (Windows XP-based) computer running HomeSeer (v2.0.4.36). I first considered xTag USB-Only System w/ One xTag Wearable Microphone, but the range of just tens of feet seemed way too limiting.

Then I had a thought... a wonderful, crazy thought... what if I could find a WiFi microphone -- one that used my existing 802.11n wireless network. After doing some quick searches, I realized that I already had such a thing: my Apple iPod touch (2nd generation since it needs a microphone on the hardware) and Skype! All I needed to do was use my iPod touch (or iPhone, or anything that has a decent Skype client) to call a Skype account running on my home automation server. I could then configure the sound output from that call to be the voice recognition input into HomeSeer's "Speaker" application that then controls HomeSeer. (Notably, the Speaker application actually need not be running on the same machine as HomeSeer, but I'm trying to be green by having only a single low-wattage computer always-on in my house, so I run it on the same machine.)

Now, if you've not been reading all my oh-so-infrequent posts, you may be thinking "hmmm, that sounds great, but how do you make the audio output from one program [Skype] become the microphone input of another program [Speaker]?"

Avid readers realize that in an earlier post I
did exactly that to Stream iTunes music to my SqueezeBox duet receiver. Using Virtual Audio Cable 4, I created two virtual audio cables -- I set up "Virtual Cable 1" as the default output channel for Speaker as shown in the first figure.



Then I set up "Virtual Cable 2" as the default microphone input -- you do that from the Control Panel -> Sound page. (It varies by Windows operating system variant.) After making those changes, you need to restart the Speaker client and at that point the Virtual Audio Cable's control panel will look like the below -- notice that there is 1 recording stream on Virtual Cable 2 -- that's the Speaker application that opened that cable as its microphone. If it's not showing 1 there, you need to try again to make that cable the default input and restart the Speaker application.


After that, I set up Skype on the home automation PC, created a distinct user account, set it up to only accept calls from my specific other Skype account, and made it auto-answer calls. I set the audio settings of Skype to have the microphone input be Virtual Cable 1 (the one that the Speaker application is doing text-to-speech on, since that input will be sent over to the speaker of my iPod touch so I can hear what the computer says to me) and to have the Skype speaker output setting be Virtual Cable 2 (the one that the Speaker application is using for voice recognition, since it's gonna play out what it hears from what I say into my microphone on my iPod Touch). The audio settings end up looking like this:


To test it, I made a call from my iPod Touch to that new Skype account. The Virtual Audio Cable control panel comes in handy here again, as it should, after the call is connected, look like:


Notice that now there is a recording stream on Virtual Cable 1 (Skype reading its microphone input, the output of the Speaker application) and a playback stream on Virtual Cable 2 (Skype writing its speaker out to the input of the Speaker application).

From that point, I'm able to give voice commands to HomeSeer via my iPod Touch. I had to retrain the voice recognizer (Windows Control Panel->Speech) for this new setup, even just to get Speaker to recognize the attention phrase. It'd be nice to not require the attention phrase and to simply take a command immediately upon Skype answering a call, but I'm not an expert with Speaker so I'm not sure it's possible.

I was also able to get this working using my new HTC Droid Incredible Android Phone, and again had to retrain voice recognition and microphone levels with that set up. Unfortunately (and surprisingly) Verizon seems to only let its Skype Mobile run over 3G and not over WiFi... this seems really insane especially for the substantially more open Android platform -- remember, Skype exists in a more full-featured form for the Apple-controlled iPhone. Regardless, I got VoIP over WiFi working using Fring and its Skype plug-in.

All in all, I'm pretty psyched to now have my whole-house microphone setup! Now if only HSTouch on the iPod Touch worked with the SqueezeBox plug-in without crashing... then I might be able to control my audio using my voice (I still use the awesome iPeng application to do that, and waiting for an Apple iPad Tablet version of that app).

12 comments:

Julie Jacobson said...

This is fantastic! Mind if we post it on Electronichouse.com?
-Julie Jacobson (editor)
jjacobson@ehpub.com

Greg Badros said...

You can certainly provide a short summary and link to it, but please don't copy it. Thanks for your enthusiasm. -G

Sped said...

Greg - are you active on the Squeezebox forums? I recently started a thread there about controlling squeezebox with voice control... If you make headroads in that direction I would be very interested in how it goes...

Tina said...
This comment has been removed by a blog administrator.
LRP said...

Enjoyed the read. Intend to do something similar but either for recording in a more quiet location and wirelessly sending the results to a dedicated machine for recording movie lines/recording scenes, or for linking the music performance in said more quiet recording location to the same dedicated system. Using Skype as well as some of the misc iOS wifi audio apps (AirMic, Remote Mic, Mobiola Headset, etc). I will have to look into HomeSeer, thank you for this blog entry. Another tool in the kit. Virtual Audio Cable's range itself in such projects is amazing isn't it? I love it!

Interesting facts said...
This comment has been removed by a blog administrator.
Skipno said...

Awesome post!! I've been tinkering with this idea for a while, and never even thought to use Skype as my microphone platform!

I'm using Indigo on Mac, and using the built-in Speech-recognition, I've programmed a number of Applescripts to execute whatever I wanted...from anywhere in the house.

The system works perfectly :) Thank you for the inspiration.

Joey Gryder said...

Greg, just wanted to let you know how much I appreciate you doing a lot of the heavy lifting for me! Finding this article has saved me a metric ton of time and energy.

I'd been toying with the idea of setting up some basic home automation with speech recognition software for a while now. This past week I've been writing up some simple "grammars" as they're called in Microsoft's SAPI, as well as putting together some basic functionality to read me the date/time, pull down weather from RSS feeds and kick off songs in Spotify (which included some UI Automation fun, *rollseyes*). The missing link was how to talk to my machine when I wasn't sitting right in front of the mic.

I've been looking all over for recommendations on array mics and conference room mics and on and on. I was getting really discouraged hearing how spotty those can be when used over any sort of distance or around any other noise interference. I thought it was a lost cause until I found your post.

Within an hour I had my recognition software talking to me over skype, accepting commands and responding back over my iPod, just fantastic stuff.

I have all sorts of plans going forward. First on the list is getting the code ready to control my HT receiver over IR so I can control audio zones in my home. But you've definitely helped the effort along, again, thanks! :)

Greg Badros said...

I'm so glad this is working great for so many folks... thanks for the comments!

Lacy Brown said...
This comment has been removed by a blog administrator.
Thomas William said...
This comment has been removed by a blog administrator.
Mary Walker said...
This comment has been removed by a blog administrator.