Mobile app version of vmapp.org
Login or Join
Rambettina238

: Is there any reason for me not to use the "wav" format for html5 audio crossbrowser compatibility? I'm targeting modern browsers (only those that support <audio>) and specifically the iPad.

@Rambettina238

Posted in: #Audio #Html5 #Ipad

I'm targeting modern browsers (only those that support <audio>) and specifically the iPad. I've tested here and wav works on chromium, firefox 4.0 (both mac 10.6) and on the iPad. I have a couple dozen audio files so I'd like to avoid multiple versions if possible.

I'll be starting and stopping the audio programmatically, no browser default controls (just buttons I attach), in case that's relevant.

Someone gave me a vague warning against using .wav; to wit:


be careful with that unless you intend to have the .wav be a pcm stream


So, any reason I shouldn't use wav for cross browser support and call it a day?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Rambettina238

1 Comments

Sorted by latest first Latest Oldest Best

 

@Pope3001725

WAV files are pretty large in size. Especially when compared to mp3s which are ~90% smaller in size. Ogg Vorbis should also be much smaller. Naturally the smaller file size is ideal for the web. Unfortunately support for different formats is varied amongst browsers.

Fortunately you can work around this by specifying multiple files and letting the browser choose the first one they support. This way .wav files are only loaded if nothing else is supported.

<audio preload="auto" autobuffer>
<source src="file.mp3" />
<source src="file.ogg" />
<source src="file.wav" />
</audio>


Update

This is the <audio> version of progressive enhancement. You can list the formats in order of preference with .wav, the largest file format, being last so only users who don't have browsers supporting .mp3 or .ogg need to load that file. Based on your requirements these users should be few and far between. If you're sure your users will support either .mp3 or .ogg then you can leave the .wav off entirely.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme