Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML
IMCreator - Free Website Builder

Web Audio

There are many ways of adding audio to a web page. Some of them are less user friendly than others (don't you love it when you're discretely surfing the web at work, when suddenly you come across a web page that starts blaring some idiotic tune at you...)

Yes, you can make a tune start playing as soon as someone loads your page, or you can give them the option to hear it, even better you can add the option for them to have full control over things like stop, start, the volume etc

Adding sound to a web page

One of the easiest ways to add an audio file is to use the all familiar " <a href= " tag. All you need to do is write something like this:

Listen to a sample of <a href="good_enough.mp3">"Good enough" by John Hall</a>

Preloading a sound file

Often you will want to preload this kind of file so that it doesn't take so long for the noise to start after the user has clicked on the link. You can preload using the following technique:

<EMBED NAME="goodenough" SRC="good_enough.mp3" LOOP=FALSE AUTOSTART=FALSE HIDDEN=TRUE MASTERSOUND>

This embeds the sound, but you've got the 'autostart' feature off (so as not to annoy people) and the 'hidden' feature to be true so that the user doesn't see a console upon entering your webpage.

Embedding an audio file

Of course, you can just go straight ahead and embed the file right into your page like so:

<embed name="goodenough" src="good_enough.mp3" width=300 height=90 loop=FALSE autostart=FALSE> </embed>

Enjoy this page?

  1. Link to this page (copy/paste into your own website or blog):
  2. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!