Search code examples
htmlaudiomp3embed

audio file embed


I am embedding a audio file and having a issue. When accessing the page where the audio file is on some web browsers i am prompted to download a quicktime plugin. I don't want anyone to need a plugin to play it or id at least want it in a format where most people already have the plugin. Here is how i embedded it:

<EMBED src="http://entersociety.com/wordpress6/demo6/wp-content/themes/Brodys/images2/08_Track_8.mp3" autostart=true hidden=true>

I want to keep it hidden and have it auto start.


Solution

  • Not all browsers will be able to play MP3 files natively. Your best bet is to use multiple formats to support the most amount of browsers possible:

    <audio hidden autoplay preload="auto"> 
      <source src="elvis.mp3" />
      <source src="elvis.ogg" />
      <!-- now include flash fall back -->
    </audio>
    

    But in short, embedded audio is still very much a work in progress for most browsers and their support for formats is all over the place.

    This article shows the native support per browser: http://www.w3schools.com/html5/html5_audio.asp

    Edit: WAV seems to be the most heavily supported - but is probably going to come with size impacts compared to MP3, and still isn't supported by IE.