Here are the results of a quick test how various browsers on OS X 10.6 (and iPhone 3GS) play HTML5 <audio>.
UPDATE 25.5.2011: I updated the data and found that the audio support has become better in many browsers. I left in old data for comparison.
|Browser / OS||mp3||wav||ogg|
- 1 plays, but is buggy
- 2 hangs on load
- 3 is able to seek!
Likewise with <video>, there is a need to encode to many formats to support all browsers. I have no data of IE9. Unfortunately Android 2.2 cannot play any audio type at all! This is supposed to be fixed in Android 2.3. See this link for more information on HTML5 audio on Android. Also, Opera 11.1 could play ogg files, but I noticed that when they were encoded in higher bitrates, the playback stopped in the middle of the track, systematically. This seems to be fixed in Opera 11.11. Chrome buggyness on wav files appears upon seeking- the play stops and cannot be started again without reloading the page.
The tests were conducted by creating a very simple HTML5 document with this content:
<!DOCTYPE html> <html> mp3: <audio src="test.mp3" controls></audio> wav: <audio src="test.wav" controls></audio> ogg: <audio src="02.ogg" controls></audio> </html>The files were hosted (locally) from the same directory as the html document by ad-hoc Python web server:
python -m SimpleHTTPServer