HTML and CSS Reference
<audio src="audio.ogg" controls>
Download <a href="audio.ogg">episode 42 of Learning to Love HTML5</a>
Also be sure to include the controls attribute if you want browsers to display a default
control interface for your audio (see Figure 4-1 ):
<audio src="audio.ogg" controls >
Figure 4-1. Default audio controls in Chrome 9 include play/pause, a progress bar, and volume/mute
The audio file in this example uses Ogg Vorbis ( .ogg ), which is a royalty-free, open
formats for the Web (see Table 4-1 ), which is one of the biggest challenges in
implementing HTML5 audio.
A codec is a technology used for compressing and decompressing data.
Audio codecs compress and/or decompress digital audio data into
different formats that aim to retain the highest level of quality with the
minimum bit rate.
Multiple audio codecs
The HTML5 specification does not dictate or make any recommendations about what
audio codecs should be supported. And since it would make far too much sense for
browser makers to agree (see http://lists.whatwg.org/pipermail/whatwg-whatwg.org/
can see in Table 4-1 .
Table 4-1. Current browser support for HTML5 audio formats
AAC ( .aac )
MP3 ( .mp3 )
Ogg Vorbis ( .ogg )
WAV ( .wav )
WebM ( .webm )