Sunny Books
What we have

HTML5 audio

HTML5 new features include audio playing support to the website via audio element, this makes embedding audio file very easy as we don't need plugins (flash) any more. This new feature will also be the new standard of playing audio files.

Example

The following example shows the basic application of audio tag.

<audio controls>
	<source src="butterfly-lovers.ogg" type="audio/ogg">
	<source src="butterfly-lovers.mp3" type="audio/mpeg">
	<source src="butterfly-lovers.wav" type="audio/wav">
</audio>

Audio Formats and Browser Support

Currently, there are 3 supported file formats for the <audio> element: MP3, Wav, and Ogg:

Browser MP3 Wav Ogg
Internet Explorer 9+ YES NO NO
Chrome 6+ YES YES YES
Firefox 3.6+ NO YES YES
Safari 5+ YES YES NO
Opera 10+ NO YES YES

Audio Attribute Specification:

The HTML5 audio tag can have a number of attributes to control the look and feel and various functionalities of the control:

Attribute Description
autoplay This boolean attribute if specified, the audio will automatically begin to play back as soon as it can do so without stopping to finish loading the data.
autobuffer This boolean attribute if specified, the audio will automatically begin buffering even if it's not set to automatically play.
controls If this attribute is present, it will allow the user to control audio playback, including volume, seeking, and pause/resume playback.
loop This boolean attribute if specified, will allow audio automatically seek back to the start after reaching at the end.
preload This attribute specifies that the audio will be loaded at page load, and ready to run. Ignored if autoplay is present.
src The URL of the audio to embed. This is optional; you may instead use the <source> element within the video block to specify the video to embed
SUNWEB EXPERT