The Web Audio API is much more suited for games than the basic HTML5 audio

Feb 1, 2012 13:21 GMT  ·  By

Angry Birds for Chrome is quickly becoming a showcase of the latest and greatest web technology. It uses HTML5 and WebGL for the graphics part. Browsers that support WebGL and have the proper drivers installed get the full hardware accelerated experience. Otherwise, HTML5 Canvas is used.

Angry Birds has now introduced support for Web Audio API, a new standard for web audio aimed at applications that require real-time response and more complex audio processing, i.e. games.

"Last week Angry Birds for Chrome was updated to use the Web Audio API for all its in-game audio for Chrome users, which means Chrome users get the full Angry Birds experience, without any plugins," Google announced.

Players probably won't feel any difference, but the move marks a milestone for the adoption of Web Audio API. Of course, the fact that Google is deeply, though indirectly, involved in the porting of Angry Birds to the web helped speed up the switch.

"Angry Birds was in no small part made possible by the cross-platform open source PlayN library. When building for the HTML platform, PlayN in turn relies heavily on Google Web Toolkit (GWT) to delivery a highly optimized web experience for users, and on gwt-voices to easily deliver a cross-browser audio experience," Google explained.

It is gwt-voices that choose the appropriate audio API to use, based on what the browser supports and what plugins are installed. It can switch between HTML5 audio, Flash audio and even native browser audio. It also supports the Web Audio API.

HTML5 audio only provides basic audio playback functionality, it's not suited for much more than playing an MP3 or the likes.

But it has been the only choice for developers that wanted to use web standards for the audio portion of their apps. Web Audio API provides much more functionality and capabilities.