PLAYING AUDIO FILES FROM YOUR WEB PAGE

I will refer to audio files as "music" for this discussion.

You have two basic choices on playing music:
      (1) The music plays "within" your browser.        
(2) The music plays "outside" your browser.

Choice (1). This file was written to play music automatically a within the browser using the tag 'EMBED'.
In the body of the HTML code, i.e. after <BODY>, the tag shown below appears.

<EMBED SRC="./3DAYSK.mid">

(The music file '3DAYSK.mid' is in same folder as this document for convenience.
You can use any legitimate audio file you like, on the web or not, as long as the path is correct.)

The <EMBED> tag is right here in the HTML code. Note that a control panel appears c exactly at that spot.
      It really works; try it!

You can put the <EMBED> tag in the <HEAD> section. The control panel then appears at the top of your page.

OPTIONS:             Complete list of options
a autostart="true" is the default. This starts the music automatically. Insert autostart="false" somewhere in your EMBED tag to allow the user the option of starting the music or not.
b loop="false" is the default. This plays the audio file once and stops. Insert loop="true" somewhere in your EMBED tag to have the audio file play continuously.
c You can control the size of the control panel. Insert width="300" height="40" somewhere in your EMBED tag. (For Windows Media Player on my monitor, the default size is about 300 x 40.) If you don't want the control panel to show, you can make the size so small that it does not show; e.g. width="1" height="1" or use the 'hidden' attribute.
d For Internet Explorer only, you can use the BGSOUND tag, i.e. <BGSOUND SRC="./3DAYSK.mid" autostart="true">
This will not display a control panel. Since you can do everything with EMBED, it seems silly to use BGSOUND that works with only one browser.

COMMENTS:
(a) Results are the same when accessed from my computer or a web site.**
**Default settings for IE with SP2 blocks access on my computer unless specifically allowed by pop-up alert.
(b) Any audio file supported by the users browser and plug-ins work as far as I can tell.

Choice (2). You can allow the user to play the music with the default application on their computer. Use the standard Anchor tag <A HREF> and point to your music file. For example, <A HREF="./3DAYSK.mid">3DAYSK.mid</A>

To see this in action; Stop the music. Then

Click here to play 3DAYSK.mid with your Audio Player, probably Windows Media Player.

STRANGE:
(a) .mid files are handled by Windows Media player even though Quick Time is my default??
(b) The options such as autostart don't work. Different plug-ins seem to use their own defauts??? (c) EMBED works on my computer with Internet Explorer but not Netscape??


Streaming Audio

Click here to stream Minuet.mp3 locally.

Click here to stream Minuet.mp3 from the web (meiere.com).

Explanation: This form of streaming audio uses a plain text file with the extension .m3u which points to the desired .mp3 audio file. In this example, using files stored locally, the audio file is 'Minuet.mp3'. The .m3u file which points to it is 'Minuet.m3u' and is simply the complete path to the audio file. Specifically, 'Minuet.m3u' is exactly this:

file:///C:/Documents and Settings/Forrest/My Documents/ComputerClub/EmbedMusic/Minuet.mp3

For files on the web, 'Minuet.m3u' is exactly this:

http://meiere.com/EmbedMusic/Minuet.mp3

'Streaming' refers to the fact that this, apparently overcomplicated procedure, tells the browser to buffer the audio file, i.e. read a few bytes into a buffer and play them. While those are playing read the next few bytes into the buffer. Keep this up until the whole file has been played. This buffering allows the music to start without the long delay that would be necessary to read the whole file before starting.