views:

297

answers:

6

Hi,

I need to use HTML 5 audio to play sounds. However, the codec support is very irritating:

  • Firefox: Ogg, Wav
  • Safari: Mp3, Wav
  • Chrome: Ogg, Mp3
  • Opera: Wav

I basically need to encode in Wav and Ogg/Mp3. However, Wav's are terrible in size and that is very crucial point for me. So, I guess I should go for Mp3 + Ogg leaving Opera and IE out?

+2  A: 

I think you have answered your own question. Since you are already leaving out IE why not leave out Opera too? You could then use Ogg/MP3 for the others and maybe get away with some simple flash for IE/Opera.

smaclell
+3  A: 

Here is a good tutorial about how you can take advantage of html5 audio tag, but still maintain compatibility for browsers that dont support html5 audio tag.

http://www.html5rocks.com/samples/audio/quick/

Vivian Li
+3  A: 

According to: http://my.opera.com/core/blog/2009/12/31/re-introducing-video, Opera 10.5 (still in alpha/beta) supports Vorbis and PCM Wav for audio. I don't believe 10.10 actually supports the audio tag.

Safari would support Vorbis (and Theora on the video side) if Apple ever bothered to include support for Xiph's codecs in the QuickTime framework (you can add it manually, of course, with XiphQT, but you obviously can't count on it for web dev purposes).

In any case, Vorbis clearly has the most coverage (Chrome has more of the market than Safari now, Opera is about half of Safari, and obviously FF is huge), and it doesn't really have the strong opposition that Theora has. I could actually see Vorbis support in Safari happening in the near future, unlike Theora.

Kelly Clowers
That was interesting, that's for lightening me up!
rFactor
Hey, why don't you believe 10.10 support the audio tag?
rFactor
I seemed to remember it that way. To make sure, I just now checked with the Modernizr HTML5/CSS3 detection library, and Opera 10.10 does not support <audio> or <video>.
Kelly Clowers
+2  A: 

Why not use Flash?

oh wait. that would be too easy.

the wheel
I have my reasons and I have my requirements. I'm asking solely in terms of HTML 5 Audio.
rFactor
A: 

If you're having to use Flash for IE anyway, why not just build it once? You're only going to have to maintain this for the next 5 years of browser updates every time something changes.

I'm not even supporting IE. In IE, users will simply hear nothing. I'm well aware of what Flash can do. I'm not asking for alternatives or such, I was asking about the very specific HTML 5 Audio feature.
rFactor
A: 

Good Lord. 3 or more separate implementations for different browsers, and even the example from the HTML5Rocks site uses suggests Flash for non-supported browsers.
Is this the open standards future? Save me.

helpless
So you only support standards that are widely-implemented from the very beginning? What do you write your code in?
Joachim Sauer
Yes that sucks, but the standard is not yet even finished. I'm sure Ogg will be chosen, eventually.
rFactor