How To Play Audio File With HTML

Surprisingly, it’s quite simple to play an audio file on a website using HTML code.  The main element I was concerned about was the user’s freedom to start the clip over and to fast forward / rewind.

First, make sure the audio file is either in a .wav or a .mp3 format.

Next, enter this segment of code into your html:


You can change the width and height attributes.  Also, you can have it autoplay and loop by changing the booleans.

After you are finished, a player looking like the one below should appear on your website

-Christina Ranalli

~ by christinaranalli on October 25, 2011.

One Response to “How To Play Audio File With HTML”

  1. This is my weakest post. Although I briefly explain how to play an audio file with HTML, it’s quite a lame way. I actually was unimpressed when I used the same technique on my own website. The viewer / listener, can’t control the location easily, can’t see the time of the video, etc. If I were to repost this entry, I would research a more user-friendly sound player.

Comments are closed.

%d bloggers like this: