HTML5 provides a standard for playing audio.
Until now, there has never been a standard for playing audio on a web page.
Today, most audio are played through a plugin (like flash). However, not all browsers have the
HTML5 specifies a standard way to include audio, with the audio element.
The audio element can play sound files, or an audio stream.
Currently, there are 7 supported formats for the audio element:
To play an audio file in HTML5, this is all you need:
The control attribute is for adding play, pause, and volume controls.
Insert content between the <audio> and </audio> tags for browsers that do not support
the audio element:
The example above uses an Wav file, and will work in Firefox, Opera , Safari and Chrome.
To make the audio work in Safari, the audio file must be of type MP3 or Wav.
The audio element allows multiple source elements. Source elements can link to different audio
files. The browser will use the first recognized format:
Internet Explorer 8 does not support the audio element. In IE 9, there will be support for audio
Your Query was successfully sent!