The HTML5 audio Tag

The HTML5 <audio> tag is useful when it comes to providing sound like audio file or music streaming. Playing sound bites is possible when the HTML5 <audio> tag is placed within a document.

The <audio> tag is not used for HTML4.01 and it is a new addition for HTML5.

All major browsers support the HTML5 <audio> tag. The list includes Safari, Firefox, Google Chrome, Internet Explorer and Opera. If in case the audio is not supported by the browser, a text will appear as notification. This notification should be placed between the <audio> and </audio>.

The <audio> tag is capable of working along with the Global Attributes and Event Attributes in HTML5. The following are the attributes for HTML5 <audio> tag:

Attribute

Value

Description

autoplay

autoplay

Specifies that the audio will start playing as soon as it is ready

controls

controls

Specifies that audio controls should be displayed (such as a play/pause button etc).

Loop

loop

Specifies that the audio will start over again, every time it is finished

Preload

auto
metadata
none

Specifies if and how the author thinks the audio should be loaded when the page loads

src

URL

Specifies the URL of the audio file

It has to be noted that all of these attributes are new ones because the HTML5 <audio> tag is not present in HTML4.01.

Featured pages

Overview

Learn about HTML5 architecture, design principles and patterns on HTML5 Overview Tutorial. Become …

Tags

Learn about HTML5 tags and discover a new list of HTML5 tags. Find out about HTML5 tags support by…

Welcome

 Learn HTML5 development techniques, tips and tricks on our website. Find out what is required…

Date Time Picker

HTML5 forms use date and time controls regularly. HTML5 date and time controls are used by booking …