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

Since this article was written back in 2000, web audio has come a long way. HTML5 has now introduced a new element for embedding audio on your web pages. It is the <audio> element.

The following example uses the <audio> element to play music on the web page.

Other Methods

Before the <audio> tag came along, webmasters used to add audio by using the <embed> tag. This tag was previously non-standard, but the HTML5 specification introduced it.

To see more about this method of adding audio, check out my HTML Music Codes page.