HTML5 Audio Example



In simplest form, one can use the <audio> element to include audio in a web page. Of course, not everything is as simple as it seems. the problem lies with encoding. MP3 is the default, but not every browser manufacturer chooses to pay the license to handle mp3 files. Therefore, we must rely on some sort of graceful degradation (just like coding unobtrusive JavaScript).

View the source code of this page to better understand how audio is included. Note that I code for controls so the audio does not start playing immediately.

Example audio file (yes, it is a stolen parody)