What Is The HTML <audio> Tag?

What Is The HTML Audio Tag

Date First Published: 27th February 2023

Topic: Web Design & Development

Subtopic: Web Development

Article Type: Computer Terms & Definitions

Difficulty: Medium

Difficulty Level: 5/10

Learn more about what the HTML <audio> tag is in this article.

In HTML, the <audio> tag is used to embed audio content, such as music into a document. This HTML5 tag supports videos in the MP4, WebM, and OGG format, is supported by modern web browsers, and includes built-in functionality to customise how the audio works on the webpage, such as pause/play buttons and volume buttons.

Note: Info Icon

The <audio> tag is only designed for playing audio. It does not display a video player with the video, like the <video> tag does.


Note: Info Icon

The text between the <audio> and </audio> tags only displays in browsers that do not support the audio element.

Example Of The <audio> Tag

An example of the <audio> tag can be seen below:

<audio controls="controls"> Your browser does not support the <audio> tag. <source src="/audio-path/audio-file.mp4" /> </audio>

Attributes

Below are the attributes for the <audio> tag.

Attribute Description
Autoplay Specifies that the video will start playing as soon as it loads.
Controls Specifies which controls to display with the audio player.
Loop Specifies that the audio should play again every time it is finished.
Muted Specifies that the audio file should be muted.
Preload Specifies how and when the video should be loaded when the page loads.
Src Specifies the URL of the audio file.


Feedback

  • Is there anything that you disagree with on this page?
  • Are there any spelling, grammatical, or punctuation errors on this page?
  • Are there any broken links or design errors on this page?

If so, it is important that you tell me as soon as possible on this page.


Comments