Beep.js
Simple wrapper around the WebAudio API
Usage:
var Beep = require('beepjs')
var volume = 1
var waveType = 'square'
var beep = new Beep(volume, waveType)
beep.init()
beep.beep([[1000, 100]])
.then(function () {
return beep.beep([[1000, 100], [2000, 100], [3000, 100]])
})
Notes:
- Whenever possible use the built-in array format for creating multiple tones. Callbacks in javascript are not precise enough and you will end up getting strange delays inbetween beeps.
- A frequency of 0 will be 'silence' and can be used as breaks in the beep array method
- the beep.init() call must happen from user interaction on iOS before any attempts to call beep.beep(...)
License:
The MIT License (MIT)
See LICENSE.txt for details