by Alexandre Alapetite on 2011-07-11; updated on 2012-07-07

HTML5 audio test

français

Introduction

The purpose of this page is to test the support for a simple HTML5 <audio> tag (without scripting), combined with different audio codecs, and different lengths of sounds, over HTTP as well as HTTPS.

Multiple formats to satisfy all browsers

In order to cover all my use-cases in 2011, MP3 + Ogg/Vorbis is needed with some trailing silence:

1 second of sound, followed by 1 second of silence

JavaScript call: ()

HTML5 audio syntax

<audio preload="auto" controls="controls">
	<source src="DTMF1000ms.mp3" type="audio/mpeg" />
	<source src="DTMF1000ms.oga" type="audio/ogg" onerror="alert('Cannot play provided audio codecs!')" />
	[This browser cannot play audio files!]
</audio>

MP3 first, due to otherwise bad support of Ogg in Android browser 2.3, but this makes Firefox Mobile 5 to fail (works in version 6).

Results

The above test works fine in:

Microsoft Windows
Desktop: Microsoft Internet Explorer 9+, Google Chrome, Firefox 3.6+ (3.5 with small bugs), Opera 10.5+, but not Apple Safari 5 (without QuickTime)
Mobile (Windows Phone): Internet Explorer Mobile 9+
Google Android
Android browser 2.3+, Firefox Mobile 6+, Opera Mobile 11+
Linux
Desktop (Ubuntu 10.10): Firefox 3.6+, Chromium 6+ (maybe older)
Mac OS
Mobile (iOS): Safari 4+ (=iPhone 3G+) to be checked

Detailed test

Codec information

WAV/PCM
Original sample. Made with Audacity 1.3, DTMF generator, amplitude 0.9, 50% duty cycle
pcm_s16le, 44100 Hz, mono
MP3
Encoder: LAME 3.98.4
Command line: lame -h --abr 64 DTMF.wav DTMF.mp3
Best for (desktop): Microsoft Internet Explorer 9+, Google Chrome, Apple Safari 4+
Best for (mobile): Internet Explorer Mobile 9+ (Windows Phone 7), Android browser 2.3+, Safari Mobile 4+ (iOS)
Ogg/Vorbis (OGA)
Encoder: ffmpeg 2011-07-08 with Lavf 53.5.0
Command line: ffmpeg -i DTMF.wav -acodec libvorbis -ab 64k DTMF.ogg
Best for (desktop): Mozilla Firefox 3.5+, Opera 10.5+
Best for (mobile): Firefox Mobile 6+, Opera Mobile 11
Webm
Encoder: ffmpeg 2011-07-08 with Lavf 53.5.0
Command line: ffmpeg -i DTMF.wav -ab 64k DTMF.webm
Bugs when playing multiple times (Firefox 13, Opera 12). Possible replacement of Ogg in Chrome.

1 second of sound, followed by 1 second of silence

MP3 1000ms + silence
Ogg/Vorbis 1000ms + silence
Webm 1000ms + silence
WAV/PCM 1000ms + silence

2 seconds of sound

MP3 2000ms
Ogg/Vorbis 2000ms
Webm 2000ms
WAV/PCM 2000ms

1 second of sound

MP3 1000ms
Ogg/Vorbis 1000ms
Webm 1000ms
WAV/PCM 1000ms

500ms of sound

MP3 500ms
Ogg/Vorbis 500ms
Webm 500ms
WAV/PCM 500ms

250ms of sound

MP3 250ms
Ogg/Vorbis 250ms
Webm 250ms
WAV/PCM 250ms

125ms of sound

MP3 125ms
Ogg/Vorbis 125ms
Webm 125ms
WAV/PCM 125ms
https://alexandre.alapetite.fr

Back