audio-oscilloscope

0.0.6 • Public • Published


logo


audio-oscilloscope

Audio oscilloscope in canvas.

License Build Status dependencies Status NPM version

NPM

Demo

https://lab.miguelmota.com/audio-oscilloscope

Install

npm install audio-oscilloscope

Usage

var oscilloscope = AudioOscilloscope(document.getElementById('canvas'), {
  canvas: {
    width: function() {
      return window.innerWidth;
    },
    height: 400
  },
  canvasContext: {
    lineWidth: 2,
    fillStyle: 'rgb(0,0,0)',
    strokeStyle: 'green'
  }
});

oscilloscope.draw();

navigator.mediaDevices.getUserMedia({
  audio: true
}).then(function(stream) {
  var audioContext = new AudioContext();
  var source = audioContext.createMediaStreamSource(stream);
  oscilloscope.addSource(source);
}).catch(function(error) {
  console.error(error);
});

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.6
    14
    • latest

Version History

Package Sidebar

Install

npm i audio-oscilloscope

Weekly Downloads

20

Version

0.0.6

License

MIT

Unpacked Size

136 kB

Total Files

12

Last publish

Collaborators

  • miguelmota