Flash MP3 Player

Jeffrey Larson

In certain cases, playing music on websites can be good. I know that some people think that adding a soundtrack to your personal website gives it that little bit of extra distinction… but when I come across those sites I usually end up turning off the sound because it gets annoying.

Since websites are about communicating content to viewer, some of that content could be sound bytes or music. A band’s website for instance, should probably have some way to allow the users to hear their latest track.

The most common way to ’embed’ music into a website is by using Macromedia Flash (I won’t go near the alternatives). Flash is mainstream, it comes installed in almost all web browsers, so it makes compatibility easy.

Flash supports a couple of different ways to play audio: embedding the audio files right in the ‘swf’ files as well as playing external files. There are a few Flash based MP3 players which use an external XML file to load the audio from a (possibly dynamic) list of tracks. I found a pretty cool player that Jeroen Wijering has created.

You can see it below, streaming a few songs that I have been listening to recently.

Anyway, this player could come in handy for integration into future website projects, and it makes it so simple.

One drawback to using the player is that it could mean more bandwidth usage depending on how it is employed. If bandwidth is a concern then you can limit the fidelity of the MP3 you use. In the example above, I’ve converted 8 MP3 files, which were originally 192 Kbps at 44.1kHz, to 48 Kbps at 22.05kHz. This basically means that the same track is then 20% its original size (granted there is some loss of quality) so the user downloads less to save bandwidth. Although I did this conversion manually to each of the 8 files, there are scripts that would allow real-time down-sampling if the tracks need to be more dynamic (see mp3SDS).

I don’t really have a good use for the player at the moment, it’s just a toy.


One Response to “Flash MP3 Player”

  • ramu Says:

    Dear Sir,
    I am creating my website and want to put this kind of mp3 player in it.
    So please advice me how I can do that.

    regards,
    Ramu