Web Audio boilerplate ========================
npm install web-audio-boilerplateWeb Audio boilerplate
========================
A couple of helpers necessary for cross-browser web audio projects.
note : in addition of this library, I recommend using @cwilso's AudioContext-MonkeyPatch for normalizing Web Audio API across browsers (prefix and method names). For convenience, it is already bound with the built version of the library.
Download
----------
- From npm : npm install --save web-audio-boilerplate
- Built version (bundled with AudioContext-MonkeyPatch) : here
API
----
Test what audio formats are supported in the current browser. Calls done(err, results) where result is an object :
``javascript`
{
wav:
ogg:
mp3:
aac:
flac:
s16le:
s24le:
f32le:
u8:
}
iOS requires a user action in order for your AudioContext to make any sound. When the HTML elem is clicked or tapped, handler(err, audioContext) is called with audioContext an unmuted instance of AudioContext`. This function is only really necessary on iOS, but you can use it safely in all browsers.
Demo
-----
There is a simple demo here. You can see the demo in action here.