The Slacker's Guide to HTML

Home
HTML
Basics
Text Tags and
Text Positioning
Images
Links
Forms
Tables
Frames
Adding Sound
Meta Tags
Horizontal Rules
Comment Tags
Tips & Tricks
HTML Tips
ASCII Codes
RGB Color Chart
Refreshing Pages
Viewing Source
CSS
Basics
Selectors
Properties
Values
Cursor Effects
Positioning Content
Measurement in CSS
Centering with CSS
Custom Form Buttons
CSS For Links
Javascript
Archive
Dynamic HTML
Archive
XHTML
Basics
Rules
Site Success Center
Site Promotion
Monetize Your Site
Extras
IE Vs. FireFox
Downloads
Myspace Comment


 

Adding Sound in Your Web Page



Basics of Sound

Adding sound into your website can make people either hate you immediately or perhaps postpone hating you for a little while. Adding music to your website will probably not make you any friends, even if it doesn't make anyone hate you.

That being said I encourage you to keep reading and have a godo time!



Embedding Sound

You can embed a sound file into your web document by including this code in the spot you want the sound control panel to appear:

<embed src="saywhat.wav" width="200" height="40" 
autoplay="false" hidden="false" loop="false" volume="75"></embed>
autoplay can be either true or false.
hidden can be either true or false. If it is hidden then the visitor will not be able to start or stop the music or change the volume.
loop can be either true or false. If it is true then it will repeat over and over...and over...and over. That will probably piss off just about everyone who stops by.
volume can be from 1 to 100, 50 being the default setting.



Background Music

<bgsound src="soundfile.extension" loop="5"&t;
That tag, which goes inside the body tag, will play the song in the backround 5 times and then stop. If you put loop="-1", then it would never stop looping. Wouldn't that be fabulous!?

Remember to make sure you loaded the sound file into your server just like you would an HTML of GIF file.