
James's HTML Help:Adding Sound
If you would like to add sound, there are two tags you can use.
One is one you would use in the <body> tag, and that is bgsound="filename.ext"
This will work, but it's kind of lame. You can also use the <embed>
tag to do it. And this is much more feasible. Check out some of the various
options, all of which work with .wav, .mid, and .au
files:
-
Automatically Load Sound
-
You would use the following code:
<EMBED SRC="filename.ext" autostart="true" autohide="false">
This tag would automatically start playing once the file was loaded
(via autostart="true") and would not hide the console (via autohide="false").
If the autohide was true, you would not see the console. If autostart was
"false", the user would have to push "Play" on the cosole to hear it.
-
-
User Controlled Playing
-
If you want the user to control the playing of the sounds, try this code:
<EMBED SRC="filename.ext" width=135 height=60 controls=console>
This will make the console visible. Pretty simple. If you only
want to show the "Play" button, use this code:
<EMBED SRC="filename.ext" width=34 height=23 controls=playbutton>
This will only show the play button. But there is a downer to this.
The only way to stop it is to reload or go to another page. Not very feasible.
And if you want the console to be limited in size, try this:
<EMBED SRC="filename.ext" width=144 height=15 controls=smallconsole>
You can change the height and width to your desires.
-
Playing Portions and Volume
-
Let's say you only want to play a certain part of the sound file. Than
do this:
<EMBED SRC="filename.ext" starttime=00:50 endtime=01:20 width=135
height=60 controls=console>
This will only play the time that you have specified. And if the
sound file has a low volume, and you want to make it louder, try this:
<EMBED SRC="filename.ext" volume=60% width=135 height=60
controls=console>
This will increase the volume by 60%. That number can obviously
change as you see fit.
Well, hopefully this has helped you get a basic understanding
how to add sound to your pages. If I have left anything out, please let
me know. And thanks again for the visit.