Until now, there has never been a standard for playing audio on a web page. Most audio is played through a browser plugin like flash or Quicktime. However, not all browsers have the same plugins.
HTML5 specifies a standard way to include audio, with the audio element.The audio element can play sound files, or an audio stream.
Audio Formats
Currently, there are 3 supported formats for the audio element:
| Format | IE 8 | Firefox 3.5 | Opera 10.5 | Chrome 3.0 | Safari 3.0 |
|---|---|---|---|---|---|
| Ogg Vorbis | No | Yes | Yes | Yes | No |
| MP3 | No | No | No | Yes | Yes |
| Wav | No | Yes | Yes | No | Yes |
The html5 code looks like this:
<audio controls=”controls”>
<source src=”http://andyrutter.com/wp-content/uploads/media/swept_away.ogg” type=”audio/ogg” />
<source src=”http://andyrutter.com/wp-content/uploads/media/swept_away.mp3″ type=”audio/mpeg” />
Your browser does not support the audio element.
</audio>
Check it in Safari browser:
[...] Audio, Video, OGG file format and an OGG converter Break for [...]