HTML Audio
The HTML <audio>
element is used to play a audio on a web page.
The <audio>
tag is used to embed sound content in a document, such as music or other
audio streams. The <audio>
tag contains one or more
<source>
tags with different audio sources. The
browser will choose the first source it supports
<audio controls>
<source src="horse.ogg" type="audio/ogg">
</audio>
HTML <audio>
Autoplay
To start a audio automatically, use the autoplay attribute:
<audio autoplay>
<source src="horse.ogg" type="audio/ogg">
</audio>
HTML <video>
Muted
To start a audio automatically,with muted audio muted attribute is used :
<audio autoplay muted>
<source src="horse.ogg" type="audio/ogg">
</audio>