In this article I will explain with an example, how to use HTML5 Audio Player in HTML.
Audio File Location
The Audio File is stored in a folder within the Website project.
HTML Markup
The following HTML Markup consists of an HTML5 Audio Player element.
The HTML5 Audio Player element has the following properties:
controls – It displays the control buttons such as Play Pause, Volume, etc. in the HTML5 Audio Player.
type – It specifies the media type i.e. MIME type of the media.
src – It is the URL of the Audio.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<audio controls="controls">
<source src="Files/Kalimba.mp3" type="audio/mpeg" />
</audio>
</body>
</html>
Screenshot
Browser Compatibility
The above code has been tested in the following browsers only in versions that support HTML5.
* All browser logos displayed above are property of their respective owners.
Demo
Downloads