Controlling Your Computer with X10: Adding Text-To-Speech
- Posted: Oct 31, 2006 at 3:43 PM
- 2,791 Views
- 6 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
|This article is continuation in Controlling Contolled Home Automation series. It shows how to control your computer from light switches, motion detectors, alarm switches, and any other X10 transmitting device|
Time Required: 1-3 hours
Video Tutorial Part 3
In the first two videos, I showed you how to control your lights from remote light switches and from your computer. In this video, I'll show you how to control your computer from light switches, motion detectors, alarm switches, and any other X10 transmitting device. If you haven't watched the first two videos, watch them before this video. They provide important background on X10 technologies and show you how to connect your computer to an X10 home power-line network.
To complete this project, you will need at least one X10 transmitter and a CM11a. The CM11a interfaces between your computer and your home power-line network, however, I couldn't find an .NET Framework library that would interpret incoming serial signals from the CM11a. So, with the help of a serial port sniffer, I created my own .NET Framework library that can receive (but not send) X10 signals. Incidentally, nothing would thrill me more than if someone extended or improved my X10 library, or simply borrowed my code to write something better.
With the help of my library and a tool such as Microsoft Visual Basic 2005 Express Edition or Microsoft Visual C# 2005 Express Edition, your computer can respond to real-world events. Anything that can trigger an X10 transmission can trigger a response from your computer. Examples of events include:
As proof-of-concept, I created a project (available in both C# and Visual Basic) that verbally speaks Engadget headlines when I flip the light switch in my office. Don't limit yourself to my example: you can use the technologies in this project in limitless ways, including developing a custom security or environmental monitoring system. To trigger events when someone opens a door or window, or during flooding or freezing, connect a security or environmental sensor to an X10 PowerFlash interface.
Besides X10, my example uses two interesting technologies: Really Simple Syndication (RSS) and speech synthesis. RSS is an application-friendly way to retrieve headlines and newsfeeds from websites such as Download Squad, MSDN, and our very own Coding4Fun. With RSS and Jerry Maguire's RSS Framework, you can add news-processing capabilities to an application with just a few lines of code.
Speech synthesis is provided by Microsoft's own speech library, Interop.Speechlib.dll. With this library, a single line of code makes your computer talk:
It's that simple, and when you understand the basics of writing code for the .NET Framework, you can combine these technologies in unique ways that meet your needs more perfectly than any software development company could imagine. Get started now by downloading either Microsoft Visual Basic 2005 Express Edition or Microsoft Visual C# 2005 Express Edition, and then watching my video.