Integratorpro logo SmarthomeUSA logo



September '03 newsletter:
the X10 Files

MP3's (and X10-based audio control)...

 

I thought this month I'd share with you a simple (yes, simple) trick for integrating MP3's into your audio system.  If you play MP3's on your PC with Winamp, there's a way to "plug it in" to the Stargate to run playlists via the keypad or X10, etc.  On the other hand, if you'd like a more elegant solution, Audiotron (from www.SmarthomeUSA.com) is custom-made for playing MP3's and WAV files (look toward the end of this letter for more info).

But first, the cheapie solution:

You'll need Winamp, a free COM port on your computer, your Stargate (of course), and a freely distributed plugin (available at http://henrik.husted.net/winamp.htm#SerialControl).  What the plugin permits is the sending of ASCII commands to your computer to operate Winamp.  While this plugin only works with Winamp 2 (make a note of that), I've found it easy to use and quite a bit of fun to play with.

In my case I actually had to buy another PCI card in order to add the COM port that I needed (most basic PC's don't come with more than a single serial connection).  But once I jumped over that hurdle, it was a simple matter of connecting to Stargate's COM3 port, and training Winamp to recognize the ASCII commands that I was going to use with my Stargate.

I first of all set up my LCD96M keypad with the menus for all my MP3 playlists (that was easy enough), but then I decided to get a little creative with an X10 8-button controller.  Before I was done, I'd managed to gain reliable control over my whole audio system using just 6 on/off buttons.  I'm actually making the code available to you below for "for your viewing pleasure!"  (P.S.: if you can't see it just go to www.integratorpro.com/archives/July'03.html).

 

I'm not going to provide a detailed accounting of everything going on here, but I'm simply using a number of X10-based events to turn on my stereo, choose stereo modes, & issue various IR commands.

If G-4 is on, that's the cue for Stargate to turn on the stereo and select the "satellite" mode (for listening to satellite based music).  It also provides visual confirmation at the keypad and selects my favorite channel.

At the same time, the command checks to see whether G-2 or G-3 is "on."  If so, it means that the stereo was just playing a CD or my MP3's, and issues the appropriate commands to stop them. 

You might notice also in this first event a number of flags that I created for Stargate to keep track of which CD is playing (when it's playing CD's, that is).


If G-2 is on, it repeats a similar process for the CD player (LD mode on my stereo).


If you then look a little lower, you'll see the events related to the MP3's.  G-3 ON is the signal to Stargate to execute a batch file which launches Winamp. 

It then waits an appropriate amount of time for the program to start (2 seconds), during which time it turns on the stereo.

So you don't get confused as you look at the code, the IR command to select "CD mode" is actually the mode I'm using for my MP3's.  ASCII commands are then sent to my PC (Winamp) for selecting a playlist and beginning play.


As you further review the code, you'll see other events that are used to select discs, playlists, fast forward/reverse, etc.  The correct IR commands are issued because Stargate is tracking X10 states (which reflect stereo modes).


 

Well, now....  For those of you who aren't yet familiar with how the Stargate sends ASCII commands to WinAmp, I realize I might have lost you on this point.

But believe me, it's really very simple.  The plug-in I mentioned above has common commands already written into it, like "play, stop, next playlist," etc.

Once the serial connection is made with your PC, the WinAmp plug-in just asks you to highlight the appropriate command and send the desired text from Stargate to "teach" it. 

The only bug I've found is that it's not a good idea (according to the author of the plug-in) to include any spaces in your ascii text (WinAmp seems to respond only intermittently if you do).

From here, you can of course run line-level (RCA) connections from your sound card to a free input on your stereo, and

ahhh -

Music.

The truth is, this is where you'll discover the true quality of your sound card.  To make the most of your "new sound system", you might find a need to upgrade.

In any event, it's a fun and inexpensive way to add a lot more music to your automated sound system. 

 


Let me just add a note here.  Some of you have been asking when the softcover edition of Integrating the Smart Home... was going to come out.

Well, it's here (finally). 

F.Y.I., the book is 8 x 11, 220 pages, and is a compilation of both books (1 and 2) in a single volume.  It's available a several places, among them SmarthomeUSA, though at the time that I write this I only see links to the electronic version.  If it's not there, you can find it at Integratorpro.com.  Included with the book is a free electronic version.

 

 

So while the above solution works fine most of the time, I have to admit that I've found the Winamp plug-in to be a little buggy on occasion.  Mainly, it seems to occasionally forget the commands that I've programmed into it (i.e. playlists, "play", "stop", etc.).  It's not a big deal to me, but the WAF (wife approval factor) is not extremely high.

As I mentioned at the beginning of this letter, there is a better (although obviously not free) solution.  The Audiotron works with your PC's music library to catalog and organize all your digital music.  It also includes Audiostation for digitizing your CD's and adding them to the library.  If nothing else, you'll no longer have to fool with loading and changing your CD tray - all your music can be stored right on your PC's hard drive!

And actually, though it does have a price tag, it's not much more than a good quality CD player.  If you're in the market for adding to your music system, I'd suggest that you check it out at the link above or go to  Smarthomeusa's website and do a search for "audiotron".



Till next time,

Andy Jackson,
Integratorpro.com
SmarthomeUSA.com
Andy@Integratorpro.com

Index to Archives