0.0.6 • Published 3 years ago

audio-oscilloscope v0.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

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

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

5 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

9 years ago