HTML5 <audio> Tag

Example

<audio src="song.mp3" controls="controls">
Your browser does not support the audio element.
</audio>
Code it Online »

Definition and Usage

The <audio> tag defines sound, such as music or other audio streams.

Differences Between HTML 4.01 and HTML5

The <audio> tag is new in HTML5.

Tips and Notes

Hint: Any text inside the between <audio> and </audio> will be displayed in browsers that does not support the audio element.

Attributes

Attribute Value Description
autoplay autoplay Specifies that the audio should start playing as soon as it is ready
controls controls Specifies that playback controls should be displayed
loop loop Specifies that the audio should start over again, when it is finished.
preload auto
metadata
none
Specifies whether or not the audio should be loaded when the page loads
src url Specifies the URL of the audio to play

Standard Attributes

The <audio> tag also supports the Standard Attributes in HTML5.

Event Attributes

The <audio> tag also supports the Event Attributes in HTML5.


Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!