HTML Basix - HTML tutorials and online webmaster tools


Htaccess code generators Code generators Tutorials

Online and offline code generators


Subscribe to RSS feed
Subscribe to the HTML Basix RSS feed.

Putting Sound on a Webpage

This page will take you through what is required to put some sound on your webpage. It's a simple process, I don't think you'll have too much trouble with it!


Auto Play
When you opened up this page, you should have heard 'Imagine' by John Lennon playing. The code was 'embedded' into the page, and can either be set to play continuously or just once. I have set this code to once for this page.

You can't see the controls for the background sound - so think twice before you set it to play endlessly, as you could drive people batty! <BGSOUND src="/images/ImagineCut.wav">

Manual Play
I have set the music below to 'show' and not to autostart. This allows visitors to your website to control the sound if they wish. It can be set to autostart, and the visitor can stop the sound if they choose to. The controls below have been set into a table with a black border.



  • use sound files with a .wav or .midi extension
  • try to keep your file under 100kb if you've set it as a background sound - it can take too long to download for some people
  • play with the width and height attributes of the controls display - different dimensions will produce more/less of the player
  • auto play runs the file when the page is opened. Set to 'no' if you wish your visitors to click the button to start the sound file
  • continuous plays the sound non-stop - choose once to only play once then stop
  • 'hide controls' doesn't show the sound player on the page - choose 'yes' if you want your visitors to control start/stop
  • 'url to sound file' - this can be an 'absolute' link (starting with http) or a relative link to where your sound file is located. Enter the full url if you're not sure on what you're doing
  • if you choose the controls to be 'hidden', an extra tag is provided to make sure all browsers can play the sound
  • if you want sound to play automatically on opening the page, the code goes into the head section of the page. If you want your visitor to control the sound - place the code where you want the player to show.

try these: Want some cool song clips for your webpage? Try Pammy's Wavs!




sound details
auto play:
width:
height:
play:
hide controls:
url to sound file:


Results will open in a new window



Site Stats     
VisitorsPageviews
Total: 8,529,130 Total: 22,862,850
Today: 851 Today: 2,475
Yesterday: 1,303 Yesterday: 3,772
Past Month: 40,393 Past Month: 116,932

1,400 visitors in the last 24 hours
This page has been visited 211,163 times
There are currently 8 visitors online
click to see where
most people online at once:
286 visitors on 06/27/2012
   You beaut











This site is © HTML Basix 2003 - 2009