Jump to content
  • Advertisement
  • entries
  • comments
  • views

WebAudio API in next release

Sign in to follow this  


For those that don't know HTML5 has two audio specifications at the moment.

The poorly performing but widely implemented 'Audio Element'

And the high performance but spottily implemented 'WebAudio API'

When we launched Revel last April, the WebAudio API was in bad shape, and mostly implemented only in chrome and a few other webkit variants.

So we made due with with the Audio Element; which has very high latency, some platform specific bugs, and requires a bit of extra work for out needs.

In Revel we use 'Audio Sprites' which means all of our sound effects are merged together in a single sound with silence breaks (padding) between each one; and has a table of contents that maps sound effect id's to positions and durations.

This is because it reduces HTTP transfer overhead dramatically, and the audio element is very difficult to work with and can exhibit bugs if you use too many of them playing simultaniously.

This meant cueing up the audio element to the proper location to play a sound, and setting a timer to go off to stop the sound after the specified length of the sound.

As you can guess the precision was not great; and suffered under heavy system load; but it generally did the job.

Now thankfully we detect for, and will use the higher performance Web Audio API; so far in tests audio is much more responsive, it seems perhaps a bit clearer; and the API is designed specificaly to play segments from start positions and durations in a buffer; so overruns seem non-existant.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!