top of page

How to add Audio in HTML

The HTML <audio> is used to add the audio clips or file on web pages. The HTML DOM defines methods, properties and events for the audio element. This allow us to load, play, pause, duration and volume.

Browsers which support <audio> elements are:

  • Google Chrome

  • Safari

  • Opera

  • Microsoft Edge/Internet Explorer

  • Firefox

Below are the Attributes :

  1. controls: add controls like play, pause, volume

  2. <source>: specify alternative audio file

  3. <audio></audio>: The text between the tag will be displayed on the web page. But there are many browsers that do not support <audio> element.


<!DOCTYPE html>
<h2> Audio of little birds singing in trees</h2>
<audio controls>
  <source src="" type="audio/ogg">




If you want to start an audio automatically , then use autoplay attribute

<audio controls autoplay>
	<Source sec= "..........." type="............">


If you want to start an audio automatically but muted

<audio controls autoplay muted>
    <source src="........" type=" .......">

Sofia Sondh

The Tech Platform


Recent Posts

See All


bottom of page