<embed> The embed tag allows you to insert audio into your Web page. It also allows you to define an audio consoleor control boxso your readers can control the sound. You should see an audio console on this very page. Audio consoles do not seem to appear with IE 4.0 for the Macintosh, however.
The newer versions (4.0 and above) of both Netscape and IE support this tag. It tells the browser it is encountering a plug-in of some sort. You may use the embed tag to display the plug-ina sound file in this casewithin a rectangular block or you may choose to hide the plug-in's visual representation. When the reader clicks on the embedded sound it either downloads, then launches and plays, or the page begins to start and then the sound plays.
We've embedded a sound file, complete with an audio console, on this very page. Refresh or Reload this page to hear the sound again.
The code embeds a file called "8990.mid" into the page, starts it automatically as soon as the browser parses the embed tag, plays it only one time, and states there is an audio console.
The code in our page looks like this:
<embed src="../assets/devx/8990.mid" autostart=true loop=false height=62 width=144 controls="console">
We also placed a background sound function into this page, for cross platform browser compatibility.
You use two types of switches when you embed audio: switches that define the source of your sound clip and tell your browser how to play it (general switches); and audio console switches, which determine what your console looks like.
src=URLname is the name of your sound file loop=true/false/X tells the browser how many times to play the sound file. True has it loop infinitely. False has it play just once. The number 2,3,4, etc. tell the sound to loop a specified number of times. Do not use the values 0 or 1 as different browsers do not use these values in the same way. Loop="-1" plays the sound file infinitely. autostart=true starts the sound playing automatically when the page loads. If you leave out the autostart switch, the sound will start playing only when the reader uses the sound controls to start it playing.
To insert an audio console into your Web page, you use the controls= switch. This switch embeds the visible audio player (or console). Readers can stop, pause, reverse, rewind, and re-play the sound depending on how many controls you give your audio console. Make sure to test audio consoles on different browsers. Different browsers display consoles differently, and some browsers won't display consoles at all.
The following is a list of several different types of consoles you can embed into your Web page:
You can also define whether the console is visible or not, it's height and width, whether it has a border around it or not, and it's alignment in relation to the text of your Web page. The following switches are used within the <Embed> command:
hidden=true hides the sound file player. Your readers won't be able to see any visual sign of the file. When people are embedding sound for background music, they'll typically hide the file. If you want to displays the sound file player, leave out the hidden= switch and use the controls, height, width, and align tags to place the sound player in the browser window.height=XX defines the depth of the block, in pixels, in which you want the sound player to appear. Width=XX define the width of the block in pixels, in which you want the sound player to appear. frameborder=no removes the border from the sound player window. border=XX sets a width for the sound player window border. This command doesn't appear to work in IE 4.0. Align= This command determines where where the console is located. It's based upon the text that follows the Embed command.
Some of the switches you can use with the Align command include:
When using the embed tag:
(Maximum characters: 1200). You have 1200 characters left.