Tuesday, 28 March 2006

Remote Speakers Output Plug-In 0.1

« Web site revival | Main | Some software items from the archive »

After two long years of putting it off and researching to see if it was truly possible, I have finally managed to create a plug-in for Winamp that streams audio to my Apple AirPort Express. Unlike a few of the other options available, this plug-in does not require any additional 3rd-party libraries or packages (like QucikTime or the .NET framework) to download and install. Plus, it runs completely within the Winamp process space; it does not need iTunes or any other program to be on the execution path. There's just one file to copy to the Winamp plug-ins directory. And all major Winamp playback operations (play, pause, stop, seek, next/prev track, set volume) are supported. Get the latest version here.

How It All Came To Be

I love Apple's AirPort Express remote speakers capability (AirTunes). It allows me to ditch the old fifty-foot audio cable that once connected my computer to my stereo receiver. However, I have a lot of audio files that will not play in iTunes because of its lack of a rich set of input plug-ins. I badly desired a way to stream audio from Winamp—which has years of input plug-in development behind it—to an AirPort Express. There were a number of open-source projects available on the web, but none of them were very good (to be brutally honest). So, I set out to build a Winamp output plug-in myself but there were a lot of hurdles to overcome.

Enter Jon Lech Johansen (aka Mr. DVD). He managed to figure out the protocol for communicating with the AirPort Express to stream audio. His little program JustePort was able to send a single track, which was just the start I needed. Using the source for JustePort as a guide, I was able to craft a bare-bones Winamp output plug-in that could stream audio to an AirPort Express. The initial version required the .NET framework to run (just as JustePort did). But I don't want to have that 100+ MB monstrosity installed on my box and I bet most Winamp users don't either. I wanted to get my plug-in reduced to one file with no 3rd-party installations required.

I stumbled around Google to find another open-source project by Marcus Glocker and Marc Balmer. These two ported JustePort to Linux—in the form of rtunes—which meant they couldn't have used the .NET framework. I used their port as a guide on how to get audio over to the AirPort Express without the aid of the .NET framework. This work led to a plug-in that was self-contained and a mere 300 KB.

Next I needed a way to configure the plug-in. JustePort and rtunes took in configuration on the command-line. This wouldn't work for a proper Winamp plug-in. So, I busted out Visual Studio and mocked up a proper (albeit minimal) configuration dialog box. With a lot of web page reading and some trial-and-error, I was able to figure out how to display a custom dialog and handle all the callback messages. Now I could prompt the user for configuration options via the GUI. And there were some nice procedures available in the Win32 API for reading and writing an INI file. They came in quite handy for persisting the user's selections.

It was time to tackle support for major playback functions like play, pause, stop, etc. None of the existing open-source projects on the Net were really meant to do more than one-song-at-a-time utilities, so I was in new territory. I dissected the Winamp interface and put together a fully-functional plug-in that responded to all the events that Winamp sent. I played, paused, stopped, jumped around the playlist and more to test it all out; after a few hours work, everything was up and running.

With all of this in hand, I figured I should give some of you a chance to enjoy the fruits of my labor. Thus, I bundled the DLL up with a (nice) README and released it as 0.1. I still am looking to add support for password-protected remote speakers and automatic discovery of remote speakers before I release the plug-in as 1.0. But I definitely think 0.1 is a stable and workable version. Please let me know what you think of it and if you find any issues that you think should be fixed before an official 1.0 release.

Posted by emilles at 12:00 AM in Software

 

« March »
SunMonTueWedThuFriSat
   1234
567891011
12131415161718
19202122232425
262728293031