I am working with html5 audio and running into some troubles with the buffer. This works splendidly in Chrome, however in Safari (and SafMob) there is noticeable latency. The idea is simple. A user clicks an img link and the img "jumps" and makes a sound. Here is an example.
Is there a way to preload the sound file so that it plays quicker? Again, my main concern is in the Safari/Safari Mobile browser.
The jQuery I am using:
$("#bell a").click(function() {
var snd = new Audio("ping.mp3");
snd.play();
$(this).stop().animate({ marginTop: "-10px" }, 200).animate({ marginTop: "18px" }, 200).animate({ marginTop: "1px" }, 300);
return false;
});
This is the code for the button:
<ul id="bell">
<li class="button"><a href="#" title="Pling">Link Text</a></li>
</ul>