Since the release of HTML5, audio can be added to webpages using the “audio” tag. Previously audios could be only played on webpages using web plugins like Flash. The “audio” tag is an inline element that is used to embed sound files into a web page. It is a useful tag if you want to add audio such as songs, interviews, etc on your webpage.
Syntax:
<audio>
<source src=”sample.mp3″ type=”audio/mpeg”>
</audio>
Attributes:
Controls: Designates what controls to display with the audio player.
Autoplay: Designates that the audio file will play immediately after it loads controls.
Loop: Designates that the audio file should continuously repeat.
src: Designates the URL of the audio file.
muted: Designates that the audio file should be muted.