Tony's word

Saturday, April 28, 2007

Embed MP3 Files Into Your Website

You have an MP3 file (a podcast, a song of your band, a lecture) and you want to share it with the visitors of your site. You can just put a link to the MP3 and let people download it or you can include it as an object and let the browser play it with a plug-in like QuickTime (and most of the times also crash the browser). Most people want to preview the audio and not wait until it downloads completely. You can play a partial MP3 file in audio player, but many people aren't aware of that.

But there's another away: a Flash player that allows you to pause and rewind the MP3. It's like an audio version of Google Video or YouTube, with the difference that the file is hosted on your server (or on another server). While there are many solutions based on Flash, this is the one I like the most. It's a modified version of Odeo player, that's used to play podcasts on odeo.com:



You just have to replace [MP3 file address] with the actual address.

Here you can see how it looks. In this audio, I have placed a song from Teresa Deng located on url=http://www.plus247.com/podcast/DLJ5.mp3:



Download



Four characters of the ASCII character set -- the left angle bracket (<), the right angle bracket(>), the ampersand (&) and the double quote (") -- have special meaning within HTML and therefore cannot be used ``as is'' in text. (The angle brackets are used to indicate the beginning and end of HTML tags, and the ampersand is used to indicate the beginning of an escape sequence.)
To use one of these characters in an HTML document, you must enter its escape sequence instead:

&lt; the escape sequence for <
&gt; the escape sequence for >
&amp; the escape sequence for &
&quot; the escape sequence for "
&#xA to enter the CRLF