Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 (IE surprisingly doesn't support WAV at all, etc).

However, apparently there's a new Web Audio standard I was unaware of. Chrome fully supports it. Mozilla states the following about Web Audio and Firefox:

Firefox currently supports the incompatible, Mozilla-specific Audio Data API, but it is marked as "deprecated" in favor of the W3C standard. Work has started to support the new Web Audio API in Firefox.

caniuse.com reports the following about support for Web Audio API.

I don't mind at all forcing the kids to use Google Chrome for development and sound not working in many other browsers. However, I don't want to be teaching them something that will not be in other browsers in the future.

I'm also reading about a possible alternative to Web Audio called MediaStreaming... Which is the future that I should be teaching?

like image 590
at. Avatar asked Mar 13 '13 19:03

at.


2 Answers

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

like image 58
Kevin Ennis Avatar answered Sep 24 '22 16:09

Kevin Ennis


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.

like image 42
William Avatar answered Sep 23 '22 16:09

William