Here are a series of relatively simple examle web pages that include sound. There are two different sound files involved encoded in three different formats: wav, aif and mp3. Both files originate from web sites providing sharable audio:
Both files where originally downloaded in wav format and later converted to aif using Quicktime Pro and mp3 using Max
Four basic ways to reference and/or include audio in a page are:
embed tag. This is not a W3C compliant tag.object tag. Preferred by W3C.The first, third and four ways of handling audio are illustrated below.
Illustrating the first way, here are explicit links to the audio files:
All six links have been tested using Safari and Firefox on a Mac running Mac OS X and all six play automatically using Quicktime. All but the ocean waves in .wav format play using Windows Media Player 11 under Windows XP from either firefox or Internet Explorer 7. The ocean waves in .wav format has a codec not supported by Media Player. Windows XP with Quicktime plays all six just fine.
To illustrate the third way, separate web pages illustrating different
combinations of object
tags and audio formats are available through the following table.
| Example # | Sound | Format | Auto Start | Loop | Safari | Firefox (Mac) | Firefox (XP) | IE7 |
|---|---|---|---|---|---|---|---|---|
| Example 1 | Alarm | wav | Yes | No | Yes | Yes | No | Yes |
| Example 2 | Alarm | aif | Yes | No | Yes | Yes | No | Yes |
| Example 3 | Alarm | mp3 | Yes | No | Yes | Yes | No | Yes |
| Example 4 | Ocean | wav | Yes | Yes | Yes | Yes | No | No |
| Example 5 | Ocean | aif | Yes | Yes | Yes | Yes | No | Yes |
| Example 6 | Ocean | mp3 | Yes | Yes | Yes | Yes | No | Yes |
The alarm clock pages fail in Firefox under Windows XP with a request to
install Quicktime. Failure for ocean pages is similar.
Presumably folks who have installed Quicktime,
for example by installing iTunes, will not have this problem.
For Internet Explorer 7, the ocean example using the aif (aiff)
and mp3 files work run properly once IE7 is given permission to
run the ActiveX control for the audio. Note the type="audio/aiff"
in example 5 is absolutely necessary for IE7. Using type="audio/aif"
will cause the example to fail.
The fourth way is to encapsulate mp3 files within FLASH. Here is an example of how this may be done using two distinct audio players written in FLASH. This is arguably the most reliable means of handling audio.