How to add an audio player to an HTML webpage?

HTMLWeb DevelopmentFront End Technology

The HTML <audio> element is used to add audio to web page. To add an audio player, add the controls attribute.

The following three audio formats are supported in HTML − MP3, Wav, and Ogg.

Example

You can try to run the following code to add an audio player to an HTML web page

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>HTML audio Tag</title>
   </head>
   <body>
      <p>Click on Play button...</p>
      <p>(Song: Kalimba which is provided as a Sample Music in Windows)</p>
      <audio controls>
         <source src = "/html/Kalimba.mp3" type = "audio/mpeg">
      </audio>
   </body>
</html>
raja
Published on 07-Feb-2018 13:29:39
Advertisements