wavebell
wavebell copied to clipboard
:bell: Catch realtime audio wave from microphone with JavaScript!
wavebell
Catch realtime audio wave from microphone with JavaScript!
Screenshot
Installation
# Install with npm
npm install --save wavebell
# Install with yarn
yarn add wavebell
Example
var bell = new WaveBell();
bell.on('wave', function (e) {
// draw oscilloscope
drawColumn(e.value);
});
bell.on('stop', function () {
var blob = bell.result;
// play recorded audio
playback(URL.createObjectURL(blob));
});
// 25 frames per second
bell.start(1000 / 25);
Notice
In Chrome 47 or above, getUserMedia
requires HTTPS to work.
So it'd be better to setup SSL for your server.
Thanks
- Mozilla web docs visualizations with web audio API
- Jos Dirksen for his great blog post about audio visualization
License
The MIT License.