How to stream mp3 from your site.
Date: Wednesday, August 06, 2003 @ 21:16:26 MDT
Topic: Education


Ever wonder why mp3s don't stream from your web site? I've noticed that many mp3 song samples on indie band sites have to be downloaded completely before they will play. MP3 can be streamed from any site if you know how to do it. The following article will detail how to set up a streaming meta file, generate play lists and a whole lot more. With just a little planning, your site will stream mp3s and your fans won't have to go through a 5 meg download on a dial up connection again.

Why just linking directly to MP3s is not acceptable.
Simply put, MP3 players like Winamp or Windows Media Player see mp3s as a file that should be downloaded and not streamed. Uploading a mp3 file to your server and creating a link to it will only cause the browser to download the file first before it opens the player. If you've visited many indie web sites you will often notice that when you click on a song a "message" will pop up asking you if you want to save the file or open it. If you choose open, the whole song downloads and then your mp3 player opens and plays the song. This is unacceptable for a couple of reasons.

First, for fans that are still on dial up, this can be a real pain. Most of the sites I visit encode their tunes in Hi-Fi Stereo and the files can be 3 to 8 meg or more. Many people will only listen to one tune if you are lucky. Second, the internet is getting more dangerous daily. Viruses can be passed from a malicious web site. Doing something that will cause a Pop up message to confirm download will scare a lot of people away. For example Internet Explorer will display the following message when a link prompts for a download; "Some files can harm your computer. If the file information below looks suspicious, or you do not fully trust the source, do not open or save this file." If that isn't enough to scare the bejesus out of a newbie, I don't know what is.

The fix is easy.
It is really simple to get mp3s to stream, avoid the download message and get a little "added Value" at the same time.

First THE META File Stuff...
We need to create a META file. Don't worry it's pretty easy. A META file is just a text file that contains the full link to the MP3. For example, lets say you have uploaded an MP3 to your web site called song1.mp3. First open a text editor such as Windows Notepad ( it can be found under accessories in your programs list ). Type in the full url (link) to the mp3file. It might look something like this: http://www.mycoolwebsite.com/song1.mp3. Notice that this is what most people put on their website to link to a tune. Now that we have the link to the mp3 in a text file we need to save it with a special name to let players know that they should stream the link in the file. Save the file as song1.m3u. The .m3u extension identifies the file as a mp3 META file and tells your mp3 player that it should stream the link inside of the file.

OK, now what?
Upload the meta file you just created (song1.m3u) to your website. Now create your link to that file and not to the mp3 file. For example: http://www.mycoolwebsite.com/song1.m3u
Now when your fan clicks on the link they will get the streaming meta file and they will be able to stream the tune.

META File PlayList...
We've seen how you can add a link to an mp3 file in the meta file and stream it. Did you know that you could put a whole list of them in there? As long as each link is on a line by its self, the player will play all of the tunes in the file. Just add all of the full links to your files (one per line) and name it our_cool_album.m3u or whatever. You can upload that and now you have a file that will play all of your tunes like a radio.  One other tip, you can also link to mp3 files that are not even on the same server as the m3u meta file.  Comes in handy when you have limited space on your host, but be aware that many sites will frown on linking to mp3 files on their host with a m3u file on your site.  For example mp3.com does not allow "deep linking" directly to an mp3 file on their site.

And another thing...
Creating a meta file to stream mp3s has the advantage of making it more difficult to download your songs. If they try to right click and save target on the m3u link they will just get that file. Of course it's pretty easy for any web savvy person to figure that one out, but it is a deterrent for the novice. If you want to add a download link, just put one on your website linking directly to the mp3 file. It's kind of cool to have all of them on there, lo-fi, hi-fi and download. Give them the option.

But Wait There's More...
Did you encode the mp3 file correctly? First of all most mp3 burners (encoders) like music match etc will default to certain settings. Unusually this is 128 kbs (kilobytes per second) in stereo. To be able to stream this file you need a connection that is 128 kbs or better. This means cable or dsl usually. Anything less than this and the tune will just sputter. Not exactly the effect we want. To avoid this, just look at the settings that are available when you encode your tune. Most programs will allow you to set many options including the bit rate. For dial-up (lo-fi) I like 24 kbs mono, for hi-fi you can use 128 kbs but if your server is having a bad day it will puke. Better to use 96 kbs or so.

Other mp3 stuff
There are other settings in encoders for sample rate (11kHz / 44kHz etc), different methods of encoding and even different encoders within the programs. Just experiment to get the best sound. These settings will affect the "tone or clarity". kbs determines the rate of the stream and who will be able to listen.

A word about stereo vs mono
At higher KBS rates stereo sounds better, but the dynamic range ( bass to highs ) will be better for lo-fi if you encode in mono.

Stand Up and Identify Yourself...
Don't forget to add your information to your mp3 file when you encode it. Most programs will allow you to add ID3 tags. These tags become part of the mp3 file and can hold info like copywrite, author, album title and many other things. ID3ver2 even lets you include an album cover. If you have the option include both ID3v1 and ID3v2 tags.

More questions?  Drop me a line: webmaster@michiganbands.com






This article comes from Michigan Bands Music and Entertainers
http://www.michiganbands.com

The URL for this story is:
http://www.michiganbands.com/modules.php?name=News&file=article&sid=671