HTML5 Audio Issues; Why Some Flash Snuck Into Angry Birds
Posted by Dion Almaer about a year ago on audio games gwt
Last week was a big week for GWT and the Web. Having a showcase application like Angry Bird will turn some heads (even if it is a fairly simple game, the brands matter to some folk).
People have taken the game apart. Some have found an easy way to cheat, and others have cringed a little at the the URL.
One of the “hey!” moments has come from people seeing that Flash is used. Ray Cromwell, long time GWT contributor and now Googler, had a bit of a back and forth with Giorgio Sardo, Microsoft’s HTML5/IE evangelist on the use of audio, so he went beyond 140 characters to discuss the issues with HTML5 audio:
This all started because after the release of Angry Birds at Google I/O, people noticed that it was requesting Flash. Angry Birds is written in GWT and uses a GWT library written by Fred Sauer called GWT-voices. This library not only supports HTML5 audio, but has fallbacks to flash and even on IE6!
There was speculation the Flash requirement was done for nefarious purposes (to block iOS) or because Chrome includes Flash, but the reality is, it was done *both* because Chrome has some bugs, and HTML5 just isn’t good for games or professional music applications.
I first noticed the shortcomings of the audio tag last year when we ported Quake2 to HTML5 (GwtQuake) shown at last years I/O, where I also demoed a Commodore 64 SID music emulator. There are two issues with using HTML5 Audio, which was originally designed to support applications like streaming music players.
Ray goes on to discuss issues around missing functionality, latency issues, and the world of mobile. It makes you want that requestSoundEvent, or more importantly the more advanced Audio APIs that Firefox pioneered and Chrome is also pushing.
I think it is great when we don’t just Rah Rah on technology, but instead realise that there is much more that we need to do:
We need 3d on the web. We need high quality, low latency, audio. We need to be able to do the things that OpenAL and DirectX can do with sound on the Web. And we’re not going to get there by sticking our head in the sand and declaring premature victory.
The library behind Angry Birds for Chrome is ForPlay, a name that was smirked about at the various sessions.
If you want to learn about ForPlay (see! :), check out the presentation by Ray and Philip Rogers where they show of the port of libraries such as GWTBox2D, and the abstraction that allows the same Java code to run on top of not just the Web, but also Java, Flash, and Android.
This new library is pretty cool, but if the thought of Java still makes you cringe, there is a talk for you… Seth Ladd has a great presentation, “Super Browser 2 Turbo HD Remix”, to help you get started in good old JavaScript.