Have ideas to improve npm?Join in the discussion! »

    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

    Install

    npm i audio-oscilloscope

    DownloadsWeekly Downloads

    11

    Version

    0.0.6

    License

    MIT

    Unpacked Size

    136 kB

    Total Files

    12

    Last publish

    Collaborators

    • avatar