I have a javascript that plays audio in the browser, using the html5 tag. It works fine in the iPhone browser, but not in Android. (Testing using
I know this is a hack, but it works everywhere (as far as I know)!
You can use the video element and convert your mp3s into mp4 and ogg files (ogg for firefox on android). You could also style it so it doesn't display any uneccesary default players. See code below:
<video id="audioTest" width="1" height="1" style="top: -100px; left: -100px; position: absolute;" preload >
<source src="audio.mp4" type="video/mp4">
<source src="audio.ogv" type="video/ogg">
</video>
You could then play it in your js code using:
var audioTest = document.getElementById("audioTest");
audioTest.addEventListener("ended",onSoundComplete,false);
audioTest.play();
I was having trouble on my Kindle Fire, and found one small thing which seemed to fix it.
<audio>
<source src="someclip.mp3" type="audio/mpeg" />
</audio>
I had mistakenly been using "audio/mp3". I'm using a player without its native controls (using HTML5/JS).