google-chromefirefoxhtml5-audiopcmadpcm

HTML5 audio Browsers unable to decode wav file encoded with IMA ADPCM


First, I apologize as I'm essentially new to working with audio.

The web application I currently work on, designed using asp.net/vb.net, allows users to record and play back audio using the Nanogong applet (http://nanogong.ust.hk/doc_faq.html). We are shifting over to HTML5 audio as support for the NPAPI plugin has been removed from most browsers (except Firefox until the end of this year).

Nanogong uses 4-bit IMA ADPCM to encode wav files. I'm able to convert the Nanogong wav file into 16-bit PCM using sox, and then using that wav file create an ogg version using oggenc2 and an mp3 version using lame. We need the ogg files for Firefox and Chrome, and the mp3 for Safari.

What I would like to learn is why browsers do not seem to be able to play the 4-bit IMA ADPCM format? Can they only play PCM format in 8-bit or 16-bit? In Firefox, firebug indicates the IMA ADPCM wav file cannot be decoded; Chrome and Opera don't mention anything in the developer console, but I'm guessing it's the same as Firefox since the file won't play in those browsers.

I've tried searching the web but there doesn't seem to be a whole lot about HTML5 audio, or most of it seems to be older information. I also see more articles about converting from PCM to ADPCM.

Any guidance or resources would be greatly appreciated. Thanks!!


Solution

  • Browser vendors are not required to support any particular audio format. There are issues such as licensing, although perhaps not so relevant in this case, which make vendors only support the most basic (such as uncompressed PCM) and common formats (MP3, OGG etc.), and in some cases would rely on the underlying system to decode audio (or video). Size of code base relative to gain could be another factor.

    4-bit IMA ADPCM would fall into the category "not so common" as of today which is likely why there is no support to find in the browsers.

    It's possible to get around this though by supporting the format manually using Audio API (which eliminates IE) and binary parsing/decoding. I am doing this is my audio-reader-js library but currently I have no support for IMA encoded data. It can be used as a basis though to implement support for this as well.