QUESTION: I am using this code on my Page to Auto Play a WAV File
<audio autoplay="true">
<source src="beach.mp3" type="audio/mpeg">

A Blank Box shows up where the Player should be and no sound Plays.

And yes the File is good and is in the same Folder as the HTML File.

I would like this file to play on iE and FireFox can anyone help?

ANSWER: The autoplay attribute should contain the value "autoplay ", not "true". Also, is the beach file .wav or .mp3? Hope this helps you, Bob.

<!DOCTYPE html>

<audio autoplay="autoplay">
  <source src="beach.mp3" type="audio/mpeg">


<!-- Andy -->

---------- FOLLOW-UP ----------

QUESTION: Thank you for geting back to me.

I foregot to ask is it ok if I use a small WAV file or mu8st it be MP3?

Bob, I'm no audio expert, but know that WAV files (although well supported) can get quite large, making user experience sluggish and undesirable. MP3 is smaller, but not without its own issues. From looking around a bit, it seems that offering several formats may be the smartest choice. Have a look here: http://coolestguidesontheplanet.com/html-5-audio/. The MP4/OGG combo seem to cover most situations.  Also have a look over here for browser compatibility charts: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats.

Best of luck,



All Answers

Answers by Expert:

Ask Experts


Andrew Hoffman


Ask me about JavaScript, CSS, HTML5/XHTML, or PHP. Chances are I'll be able to help you. I know the economy is in the tank, but if you like my answer, please consider donating a few bucks. It's like tipping your barista, if your barista served fresh code instead of coffee.


I started doing this when boy bands were still cool.

I read a lot of nerdy books to get here.

©2017 About.com. All rights reserved.