Thursday, May 23, 2013

HTML 5 and audio tag - browser support

Having to do some unplanned development which involves audio in support of accessibility for the vision impaired.  I was pleasantly surprised when some initial prototyping (aka figure it out and get it into production yesterday) ended up working correctly early on when testing with Firefox.  When I moved onto Chrome the excitement started to fade when Chrome refused to allow replaying an audio clip.  And then the mood went further south when trying IE and finding that the HTML 5 audio tag (at least in IE 9) doesn't work with wav files.  And of course, other documentation indicated that Firefox didn't support MP3 with the audio tag - which doesn't matter much since the only format available to me is dynamically generated WAV data from a third-party servlet.


Fortunately, the 3rd party stuff is open source.  It hasn't been updated since 2009 but the good news is the underlying framework, Java Sound, now supports MP3 which it didn't in 2009 it seems.

I think I am heading down the road of reworking the 3rd party good to support MP3 at this point.  I had looked into a multitude of other possibilities and none were panning out.
  • audio.js
    • The fallback to Flash isn't working and appears to be related to some specific data aspects of the WAV data we are using.
  • Found some thread talking about code which needed native libs which I don't really want to deal with.  Been there and done that and in our environment it would be a disaster waiting to happen.
  • Found a thread talking about NestedVM which allowed conversion of native code to Java bytecode.  My quick review of this found some pretty negative items.  
  • Other weird or impractical ideas which I may include/update here at some point but it is getting late.

Anyways, it looks like the Java sound api has improved and includes much more functionality now and appears to be the best option which I hope won't turn into a blackhole for my time.

No comments:

Post a Comment