start page | rating of books | rating of authors | reviews | copyrights

Book HomeDesigning Web AudioSearch this book

8.6. Start your own MP3 radio station

SHOUTcast is the most popular software used for streaming MP3 to the world. (MP3 streams are not saved on the user's hard drive but are listened to as they're downloaded.) SHOUTcast comes from Nullsoft, creators of the Winamp MP3 player. Much as HTML editors made it possible for anyone to publish text and graphics on the Web, the SHOUTcast application and server (shown in Figure 8-14) makes it possible for the masses to broadcast audio over the Internet with a minimum amount of hardware and knowledge (although a good bit of bandwidth definitely helps).

Figure 8-14

Figure 8-14. The SHOUTcast DSP plug-in for Winamp lets you redirect MP3 streams to server software for Internet distribution.

Icecast

An open source, free alternative to SHOUTcast also exists called Icecast (http://www.icecast.org). Icecast was created in 1999 by two coders, Jack Moffitt and Barath Raghavan, to provide an open source audio streaming server that anyone could modify, use, and tinker with. It was further developed under the GNU General Public License by many people scattered around the globe. The upside is if you are a programmer you can use it free of charge and alter it in any way. The downside is that Icecast is a little more difficult to configure and set up, though you may find the payoff is worth the effort.

SHOUTcast streaming technology is a distributed architecture that lets people stream to the world, even over analog modem connections. However, keep in mind that a modem connection alone won't let you support many simultaneous listeners -- to do that, you'll need to redirect your stream to a high-bandwidth server. SHOUTcast's unusual architecture lets you stream your MP3 files to a SHOUTcast server (which may be running on your machine or on someone else's machine, with permission) using your Winamp player and the SHOUTcast DSP plug-in. The SHOUTcast server (which requires a higher-speed connection) is available for Windows 95/98/NT and many Unix variants, including Linux.

Using SHOUTcast is much like using other streaming/distribution software, particularly those that use reflectors, such as CUSeeMe (a video conferencing application from White Pine Software). The idea is that you can distribute one stream to many users at once. This model is much like a typical radio distribution, where one broadcast goes out to many, who simply use a player to "tune" in the desired frequency. The distribution model for SHOUTcast streaming is as follows and is illustrated in Figure 8-15.

Figure 8-15

Figure 8-15. Model of the SHOUTcast Internet distribution

To listen to a SHOUTcast server stream, just open Winamp (or any other stream-capable MP3 player) and bring up the Open Location dialog box. Enter the URL of the server you want to listen to and hit Enter. For a list of SHOUTcast servers, visit http://www.shoutcast.com. Other streams can be found at http://www.icecast.org or http://www.live365.com. Once you've got a directory listing, try searching for a band or genre name and clicking the link to the stream you want to hear. Your preferred MP3 player will be launched and will start playing your stream automatically.

SHOUTcast is free for download for general non-profit use. For commercial use of SHOUTcast beyond the 14-day trial period, a one-time licensing fee of $299 will apply. Using SHOUTcast requires a bit of preparation and configuration, but it can be a lot of fun.

Variable quality

MP3 streams dished up by streaming servers may be heavily downsampled by the person running the station in order to get their music through the skinny pipes of the Plain Old Telephone Service (POTS). In addition, many files are broadcast at very low bitrates, and lower sample rates, or in mono rather than stereo. In any case, don't expect streaming MP3 to sound as good as downloaded MP3. The Internet is too slow for most people, so it's just not possible. Many people feel MP3 sounds better at very low transmission rates than do competing formats like RealAudio, but you'll have to judge for yourself.

8.6.1. Running your own station

In a nutshell, here's what you do to set up your radio station:

  1. Install the SHOUTcast DSP plug-in for WinAmp.

  2. Configure the SHOUTcast server software.

  3. Using the Winamp player, simply choose the files you want to stream (you can also stream live content via the Live Input plug-in), and press Play on the Winamp interface.

The SHOUTcast DSP plug-in re-encodes the playing audio at the desired transmission bitrate and then transmits that audio to a SHOUTcast server, running either on your own machine or on another machine with a faster connection. Metadata relating to your transmission, including IP address, URL, genre, station name, etc., will be transmitted to SHOUTcast's central server, shown in Figure 8-16, so other listeners can find you. Your connection between the player and the server must remain open until the transmission has been completed.

Figure 8-16

Figure 8-16. The radio directory at http://www.shoutcast.com, which includes a listing of online radio broadcasts

The Nullsoft SHOUTcast server runs as an application on supported operating systems such as Windows 95, 98, and NT, FreeBSD, and so on. The SHOUTcast server will accept connections via the SHOUTcast DSP plug-in in order to have a source stream to broadcast. You must keep the connection open, as the server streams what you are actively sending it via the Winamp plug-in. Once a stream has begun, the SHOUTcast server accepts only connections from other copies of Winamp in order to broadcast that source stream to each listener. In effect, you've just set up a microbroadcast system that allows people to broadcast audio content in any of the formats that Winamp supports. Through the use of specialized SHOUTcast broadcasting plug-ins, audio from a microphone as well as any device attached to the line-in port on the broadcaster's soundcard can be streamed via the SHOUTcast server. The SHOUTcast server is the key to connecting many people to one another via Winamp.

8.6.1.1. Installing the SHOUTcast DSP plug-in

The Nullsoft SHOUTcast DSP plug-in is a direct sound plug-in that enables Winamp to interface with the SHOUTcast server software. This plug-in is available only on the x86/Win32 platform, so if you are running any version of Windows 95/98 or Windows NT 4.x (Intel platform), you can stream to any number of SHOUTcast servers. The SHOUTcast server, unlike the interface plug-in, is far less platform- dependent and has builds for many operating systems. To communicate with any of those servers, regardless of platform, all you need is this plug-in with a copy of Nullsoft Winamp 2.2x.

After downloading the plug-in from http://www.shoutcast.com, install it as described in Section 8.3.5, "Plug-ins" of this chapter. Start Winamp and tap Ctrl-P to bring up the Winamp preferences. Select the DSP/Effect subcategory under the Plug-Ins tree. If you see the SHOUTcast Source for Winamp written in the right pane, then you have successfully installed the plug-in.

8.6.1.2. Installing an appropriate MP3 codec

The DSP plug-in depends on the presence of an MP3 codec on the system running the source streamer. Because NullSoft can't provide this codec without paying huge amounts of money to Fraunhofer, they assume that the user already has an appropriate MPEG codec installed. Fortunately, users can freely download the codec from Microsoft or purchase a higher quality codec from a third party. To see if you have the codec installed on your system, launch the Windows Control Panel and navigate to Multimedia Figure 8.6.1.2 Devices. Look under the Audio Compression Codecs section for an entry labeled "Fraunhofer IIS MPEG Layer-3 Codec." If you're using a recent version of Windows, or if you've installed the latest version of the Windows Media Player, you probably have this already. If you don't, you can install the codec that comes with the Microsoft NetShow tools package. You'll find a link to the latest version of this package at http://www.shoutcast.com/download/broadcast.phtml#miscdownload.

Note, however, that the Microsoft-provided Fraunhofer codec is limited to streams of 56 Kbps. While this should be plenty of resolution for almost all MP3 broadcast implementations, those with special high-bandwidth needs may install a high-end codec available from http://www.opticom.de.

8.6.1.3. Installing the SHOUTcast server software

Once you've selected the SHOUTcast DSP plug-in in Winamp's plug-in preferences panel, everything played in Winamp will be sent to the SHOUTcast server as well as to your own speakers. The server, however, will not redistribute music to the masses until it's been launched and enabled. Launch the SHOUTcast server (probably at c:\program files\shoutcast\sc_serv.exe), and you'll see a panel with a simple reporting window, which will show you what the server is up to at any given moment.

The default configuration of the server should be fine for starters, so you can now test the system. Make sure something is playing in Winamp, and then go to another machine, launch a broadcast-capable MP3 player, and enter the IP address of the host machine along with the port number. On a common "Class C" network, you might enter something like:

http://192.168.0.3:8000

If you have a real IP address, you might enter something like:

http://202.14.123.33:8000

After a brief delay, downsampled music playing through Winamp on the remote machine should start to play on the client.

8.6.1.4. Additional server options

Beyond the defaults, the server software offers a ton of additional options. All configuration of the SHOUTcast server is (as of this writing) accomplished by editing the text file sc_serv.ini, which you'll find in the SHOUTcast installation directory. The file can also be accessed via the server's Edit Config pull-down menu. The config file is very heavily commented (commented lines begin with a semicolon) and should be relatively self-explanatory. Since sc_serv.ini is read into the server's memory when it's launched, you must kill and restart the SHOUTcast server after making any configuration changes. Note that many of the options in the config file are simple on/off switches, where 1 represents on and represents off.

8.6.2. Configuring and starting the system

Select that entry, and a dialog will appear. To configure settings relating to your SHOUTcast stream, click the Set button to establish your stream settings.

The default configuration assumes that the SHOUTcast server is running on the same computer as Winamp. To change the configuration so that Winamp streams audio to a different server, click Set and enter the IP address of the machine that will be running the server software (which is probably you for now, but may be another machine later on). Next, enter the port number for the server in the Port field (the default is probably fine). If the server has a password set to prevent unauthorized streaming, enter it here. If you wish to have the server listed in the online SHOUTcast directory, make sure there's a check next to the Public Server option. Once you've entered everything correctly, click OK and then Connect. If all has been done correctly, it will display a little message that states "Source stream connected" in the bottom of the SHOUTcast Source window. You may now minimize that window and begin to play audio files within Winamp to have it streamed to your audience.

Now all that remains is to tell your audience how to tune in. Tell them to open Winamp, press Ctrl-L or go to the Open Location option in the Winamp main menu, type in http:// followed by the IP number of the SHOUTcast server, followed by a colon and the port number you were also given. For example, a complete URL might look like this:

http://128.54.104.34:8080

Winamp should automatically connect and begin streaming audio their way. For more information, please refer to the SHOUTcast documentation.

Linux/Unix help

Most of these instructions assume you're working in Windows, but the SHOUTcast server is available for Linux and other Unix-like platforms. Configuration instructions are virtually identical for both operating systems. Linux users need to change permissions on the server binary with chmod u+x and to make sure the config file is readable by the user who is running the server. If the user is not root, he or she will not be able to use port addresses lower than 1024. Also, only the server component is available to Linux users, not the Winamp source stream plug-in. If you use Unix or Linux substitute sc_serv.conf wherever sc_serv.ini appears in this chapter.

8.6.2.1. An easier way?

If you'd like to run a streaming server without having to jump through so many hoops, and you are willing to experiment with an easy-to-use, free operating system designed for these kinds of things, download BeOS for free from http://www.be.com. Once installed and configured to your liking, download the audio player SoundPlay from http://www.bebits.com. Enable SoundPlay's HTTP plug-in, then open any web browser and enter the machine's IP address on port 80. For example, if your machine's IP address is 125.34.88.201, enter http://125.34.88.201:80. You'll see a page with Play and Stream buttons for each file in the current playlist. Users can stream files or playlists directly from your machine with no further configuration required.

8.6.2.2. Complying with copyright laws

Musical compositions and sound recordings are creative works that are protected by the copyright laws of the United States (title 17, U.S. Code) and other countries. Under U.S. law, the owner of a copyright has the exclusive right to (and to authorize others to) reproduce the work, use parts of the work in a new creation, distribute the work in whole or in part, and publicly display or perform the work (including on web pages and through webcasting). With few exceptions, it is illegal to reproduce, distribute, or broadcast a sound recording without the permission of the copyright owner. It is your responsibility to comply with the copyright laws when you become a webcaster or offer files for download.

There have been recent amendments to the copyright law regarding webcasting of sound recordings. These new provisions allow web-casting under the terms of a statutory license, as a way to help web-casters get permission without having to go to each sound recording's owner. The statutory license, however, has strict requirements that you must follow. Some of these requirements include the payment of license fees, limitations on the number of songs from the same album or artist that may be played in a three-hour period (called the sound recording performance complement), a prohibition on publishing advance playlists, and a requirement to identify the song, artist, and album on the website. There are other requirements as well. The Recording Industry Association of America provides quite a bit of information on copyright law as it applies to webcasting, and both ASCAP and BMI have created license agreements that they are willing to grant to webcasters that they believe conform to the provisions of the new copyright rules for webcasting.

For additional information on the statutory license and other aspects of webcasting, visit the following sites:

If you are uncertain about what you can and cannot do, we suggest you check with the copyright owner or the owner's representatives (or the organizations above), or consult a lawyer.

8.6.2.3. Basic rules of the road

If you choose to transmit information and music via the Internet in this radio-like fashion, remember to observe basic laws of decency, and use common sense. Just because anyone can gain access to the technology does not mean everyone has a license to abuse the privilege. Be smart and present material that the Internet community can use and enjoy.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.