WebSL...we need it...urgently!

With the arrival, and undoubted success, of WebGL (which is OpenGL-ES with JavaScript bindings, some security issues resolved and handy file loading) - we’re in a position where games on the web - in a browser - without plugins - is soon to become a reality.

The problem is that the existing HTML5 <audio> features are 100% useless for game sound effects and music. There is no specification for playing multiple sounds at once - the latency between telling the sound to play and it actually happening is awful - there is no stereo (let alone spatialised 3D) control - no good way to do frequency shifting - not even a way to pre-load an entire sound file so it’s ready to play instantly. None of the existing implementation allow a sound to be looped seamlessly.

Basically, the only thing <audio> is good for is playing background music (and even then…it’s not so great).

What the world needs is for a standard like OpenSL-ES or OpenAL or something like that to be added into our browsers - without plugins - and with the kinds of level of cooperation between Apple, Google, Mozilla and Opera that we’ve seen happening with WebGL.

So is there any prospect of kicking off a “WebSL” effort? The world DESPERATELY needs it…and soon. It ought to be possible to leverage the work done on WebGL to show how the JavaScript bindings should look - how things like loading files should be handled. It should be feasible to use the existing cordial & cooperative spirit between Khronos and Apple/Mozilla/Google to get such a thing built into both the Mozilla engine and the WebKit engine that powers Chrome and Safari (and a bunch of cellphone browsers).

It would be a match made in heaven.

Hi Steve,

I appreciate your input. I agree that having access to advanced audio functionality in a web browser with native bindings is a natural next step of development for web based rich media. By extending full native rich media support to the web, which could also include imaging and streaming media, it would bring web deployed applications to a whole new level of user experience.

The web is driving and demanding cross platform standards like never before. Web applications are the purest form of a portable application – it gets deployed on multiple platforms without modifications from the same source. This presents a challenge to web browser vendors in that a browser needs to provide identical functionality, or at least behavior, to the web application on any arbitrary system.

WebGL has solved many of the problems of creating JavaScript bindings to an existing API, which could be applied to an audio solution. OpenSL ES, with its use case driven approach to application access of advanced audio functionality would be well suited to do the same, and I for one would welcome such an effort.

So to address your question: Is there any prospect of kicking off a “WebSL” effort? The answer lies with the browser vendors. As an industry consortium, Khronos caters to the needs of its members. If the browser vendors feel that this is an area that needs cooperation, then I would say the answer to your question is “Yes.”


So who do we need to talk to?

I really want to see compelling, sophisticated games on the web - and the HTML5 <audio> tag ain’t gonna cut it. But I’m just a lone developer - I don’t have contacts with the people who could push this. I know that without good audio, it’s going to be an uphill struggle to get the big-name games companies (several of whom I’ve worked for) to get interested in web-based games without something much better.

Incidentally - I’ve also been talking to the OpenAL guys. The OpenAL library is already widely used and loved by the games industry (lots of major games are built on top of it). I wonder whether a better choice might be to base a Web/game audio standard on that. The OpenAL guys feel that it would be a lot simpler to use the OpenAL API to build a “WebAL” implementation on top of OpenSL-ES for mobile platforms and to use native OpenAL on desktop platforms because OpenAL has hardware support on Creative Systems PC cards and Apple desktop/laptop products.

Anyway - I wouldn’t want to pre-judge the standardization process…the big question is how to get the relevant players to the table.

Many of the browser vendors are part of the WebGL working group, as are a number of silicone and software vendors. Therefore, contacting the WebGL working group and letting them know that as a game developer you would like to have an audio companion API to WebGL is a good place to start.

I have made the OpenSL ES working group aware of your request, and I will bring it up for discussion in the near future. It’s a first step in setting the wheels in motion.


I have written a white-paper describing why we need it, what it should be - and how I think it should happen:

http://www.sjbaker.org/wiki/index.php?t … r_browsers

Please SPAM it to anyone who will listen!

I also created a mailing list to centralize the discussion: