HTML
Audio

The HTML <audio > tag is used to is used to embed sound files into a web page. It plays by native support for audio playback built into the browser rather than a browser plugin.

Audio Breakdown

Here is the breakdown of HTML Audio.

Audio Attributes

AttributeDescription
srcIt specifies the URL
autoplayIt specifies that the audio will play automatically
controlsIt specifies that the audio controls get displayed
loopIt specifies that the audio will start again every time after finish
mutedIt specifies that the audio should be muted
preloadIt specifies how and when the audio file should load

Audio Example

Below example will demonstrate the basic architecture of HTML Audio.

                    

<!doctype html>  
<html>
    <head>
        <title>HTML Comment Example</title>
    </head>
  
    <body>
        <audio controls>
            <source src="myAudio.mp3" type="audio/mp3">
        </audio>
    </body>
</html>