HTML Audio Tag
The HTML <audio> tag is used to embed audio content in file on a web page.
Attribute | Description |
---|---|
src | It is used to set the URL or path from where the audio file will get fetched. |
height | Sets the height of the audio player |
width | Sets the width of the audio player |
autoplay | Specifies that the audio will start playing as soon as it is ready |
controls | Specifies that audio controls should be displayed (such as a play/pause button etc). |
muted | Specifies that the audio output of the audio should be muted |
Example
<audio width="350" height="220" controls autoplay> <source src="demo/sample.mp3" type="audio/mpeg"> </audio>Try it Yourself