3 ms·
The main point of the web audio api is for procedural generation of sounds rather than playing of pre-computed buffers or files. This is why "new Audio('effect.
by doublec 14y ago
The main point of the web audio api is for procedural generation of sounds rather than playing of pre-computed buffers or files. This is why "new Audio('effect.wav')" isn't a real alternative to it.
- kevingadd 14y agoMozilla had procedural audio generation through <audio> with a simple, documented API back when Chrome couldn't even play non-procedural audio through <audio> properly. http://phoboslab.org/log/2011/03/the-state-of-html5-audio http://phoboslab.org/log/2011/03/the-state-of-html5-audio Procedural audio is also effectively a corner case compared to the vast majority case, which is playing static sounds.
- comex 14y agoSimple, documented, and slower - you had to do everything in JavaScript. Web Audio API retains the ability to use JavaScript but provides a nice set of fast primitives.
- chipsy 14y agoMore to the point: As soon as you want to mix audio levels, <audio> alone is completely insufficient. You need mix control in order to fade background music and loops. I consider this a basic need; the Mozilla API allows you to roll something yourself, but Web Audio is more clearly suited to the application.