HTML Audio tag provides you to embedding an audio file on a web page.
<audio> Tag
<audio> tag is used to define the sound content. controls
attribute adds audio controls, like play, pause, and volume.
autoplay
attribute allow audio to play automatically. <audio autoplay>
…
Add muted
after autoplay
to let your audio file start playing automatically (but muted). <audio controls autoplay muted>
<source> Tag
<source> tag defines multiple resource elements. For audio control the resource element is nothing but your sound file.
This sound file is specified with the help of name and it type.
Example
See the Pen audio tag by Arpit (@soniarpit) on CodePen.
Previous: #26 HTML Input form* Attributes
Next: #28 HTML Video Control