Skip to content Skip to sidebar Skip to footer

Future Of Javascript Audio?

I'm teaching kids how to add audio to their JavaScript games and webpages. I knew about the HTML5 Audio API and am just now learning about the issues around the various browsers (I

Solution 1:

Strictly speaking, there's really no HTML5 Audio API. But HTML5 did introduce the <audio/> element, which is great for simple use-cases.

If you need high-precision timing, or the ability to perform DSP -- I'd go with the Web Audio API. It's still a draft as far as the W3C is concerned, but it seems fairly clear that this is the direction they're going in: http://www.w3.org/2011/audio/wiki/PubStatus

Solution 2:

There is no promise that the web audio API will be in all browsers but it is available in Chrome,Safari,and supposedly scheduled for Firefox. Opera has just changed their engine to webkit which is the engine used for the current batch of Web Audio API supporting browsers. Internet Explorer is completely up in the air.

Solution 3:

If all you need to do is play audio files, I would strongly recommend using howler.js. It doesn't have a ton of features, but it is very reliable, and works well across browsers.

The Web Audio API is definitely 'the future' of audio on the web, but it can be pretty complicated, especially if you're trying to teach it to children.

Solution 4:

I read somewhere that microsoft is also getting engaged in the web audio api and others

Also some features like capturing audio are only supported by canary or has this changed lately? When will the entire API be supported by the standard chrome webbrowser? Another problem I had with the audio API is that when you have to do some calculations for DSP as Kevin Ennis mentioned, then javascript has problems to do so and your browser crashes. I tried to figure out why it crashes but all I could find is that javascript is not the rights choice for heavy calculations. So as far as web audio API supporting DSP I'm not convinced.

I think it will still take a lot of time since you can create a website that uses web audio API and that will be supported in a lot of browsers and that will not crash randomly. But there is not real other choice for the moment so in the future I am guessing that more and more browsers will start supporting it.

Solution 5:

If you are expecting the game should run only in the modern browsers you can checkout the audio library musquito. It's relatively new and it's completely based on Web Audio API.

musquito also supports audio sprites that helps very much in games.

If you are looking for a fallback mechanism for older browsers then howler.js is a good option.

[Disclaimer: I'm the creator of musquito]

Post a Comment for "Future Of Javascript Audio?"