To play audio in HTML 5 we can used the <audio> element. <audio> element is introduced in HTML 5 before that audio files could only be played in a browser with a plug-in (like flash).
HTML 5 support three file format, these are MP3, OGG or WAV.
Autoplay: autoplay attribute is used to play an audio automatically .
<!DOCTYPE html>
<html>
<head>
<title>audio autoplay</title>
</head>
<body>
<audio src="" autoplay>Sorry your browser does not support embedding audios.</audio>
</body>
</html>
Controls: The controls attribute is used to provide audio controls, like play, pause, and volume.
<!DOCTYPE html>
<html>
<head>
<title>audio controls</title>
</head>
<body>
<audio src="" controls>Sorry your browser does not support embedding audios.</audio>
</body>
</html>
Loop: It is used to play an audio again and again.
<!DOCTYPE html>
<html>
<head>
<title>audio autoplay loop</title>
</head>
<body>
<audio src="" autoplay loop>Sorry your browser does not support embedding audios.</audio>
</body>
</html>
Muted: To mute the audio muted attribute is used.
<!DOCTYPE html>
<html>
<head>
<title>audio controls muted</title>
</head>
<body>
<audio src="" controls muted>Sorry your browser does not support embedding audios.</audio>
</body>
</html>
Src: To specify the path of audio src attribute is used.
<audio controls>
<source src=".mp3" type="audio/mp3">
<source src=".ogg" type="audio/ogg">
Sorry your browser does not support embedding audios.
</audio>