title: jQuery HTML5 Audio, alternate format for older browsers
body: <p>I'm new to jQuery and I'm trying to work a solution that will be able to play sound files on most browsers.  I have a working piece of code using jQuery and the audio support of HTML5.  It will support most of the new browsers but won't work with older browsers.</p>
  
  <p>Is there a jQuery plugin that could work with the older browsers.  Worst case scenario, I can convert the mp3 files to swf and try to play them using jQuery, if possible.</p>
  
  <p>Here's my code</p>
  
  <pre><code>&lt;html&gt;
   &lt;head&gt;
  
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
  
    &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
  
      var sound = $("#sound")[0];
          $("#play").mouseover(function() {
              sound.play();
          }).mouseleave(function(){
              sound.pause();
              sound.currentTime = 0;
          });     
      });  
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;audio id="sound"&gt;
          &lt;source src="sound.ogg" type="audio/ogg" /&gt;
          &lt;source src="sound.mp3" type="audio/mp3" /&gt;
          Your browser doesn't support HTML5.
      &lt;/audio&gt;
  
      &lt;span id="play"&gt;Mouse over to play sound&lt;/span&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>`</p>