Embedding Audio in Your HTML Page

Sound File Formats

  1. .WAV This is the original Windows file format: Although it used to be proprietary to Windows, you can actually play it now under any of the newer browsers, even on a MAC or on a UNIX machine. The .wav file format does not take advantage of any compression. Consequently, your file sizes will be extremely large and may take a while to download.
  2. .AIF (or .AIFF) Audio Interchange file format: This common file format is cross platform, but again does not take advantage of any compression codecs.
  3. .M4A or .MP3 (MPEG 4 Audio): Both file formats are part of the MPEG2 standard. With them, you can create small files while maintaining a pretty high sound quality. It is nonproprietary and you can achieve 1:10 or 1:12 compression rates with CD-quality sound. It works very well with the Quicktime Player which is cross platform. I found that the MPEG 4 Audio has a better compression rate.

Compressing Sound Files (free compression software)

To encode your audio files, you need to download an audio file encoder. I had good luck with the free application WavePad. Download it from the Audacity Audio Editor page.

Adding Sound Files to Your Page

Using the Embed Tag

<embed src="file.wav" width="32" height="32"></embed>

Using the Embed Tag with Player Properties

<embed height="20" src="file.m4a" volume="50" loop="true" controls="console" autostart="FALSE" width="128" PLUGINSPAGE="http://www.apple.com/quicktime/download/win.html"></embed>

Examples

The files load from top to bottom of the HTML page that is why you can play the first file before the last one in the following list.

Embedding a .m4a or MPEG 4 Audio file 409 KB

Embedding a .wav file 10,330 KB

Embedding a .mp3 file 938 KB

Recommendations

I recommend using the .m4a file format because it produced a high quality sound with a small file size. Here are instructions for your students to download Quicktime and set the MIME or file type default settings.

Directions for Downloading Quicktime