Giter VIP home page Giter VIP logo

wavesvg's Introduction

wave svg

wavesvg

  new waveSvg({
    buffer: Audiobuffer,
    maxHeight: 300,
    width: 1300, //<default window.innerWidth>
    pixelsPerSecond: 200, //<default window.innerWidth>
    appendTo: dom node, //<default document.body>
    max: 0.2 //<defaults to the tallest audio peak>
    workerPath: "path to worker" //<defaults to peak-worker.js>
    downSample: 16 // <defaults to 16> -- higher num for faster render
  });
interface
  instance.updatePixelsPerSecond(n);
  instance.updateMaxScalar(n);
  instance.updateDownSampleRate(n);

streamsvg

  navigator.webkitGetUserMedia({audio: true}, function(d) {
    new streamSvg({
      maxHeight: 300,
      pixelsPerSecond: 200,
      stream: d,
      max: 2
    });
  });
interface
  // you can also not pass a stream and just call
  instance.onstream(buffer);

To Dev

  cake watch

To Build From Source

  cake build

wavesvg's People

Contributors

samccone avatar kevincennis avatar

Stargazers

 avatar Cat  avatar Michael Anthony avatar Jake Buob avatar Will Farrell avatar  avatar

Watchers

Jeff Escalante avatar James Cloos avatar  avatar  avatar Michael Anthony avatar  avatar

wavesvg's Issues

Use Web Workers

I don't think stream-svg needs this (and it could possibly cause race conditions, i guess) - but wave-svg should probably be tweaked so that getPeaks happens in a Web Worker. That function is kind of expensive, and it'll lock up the UI - especially if you're processing multiple buffers simultaneously.

So with a worker, the flow would be like...

constructor();
webWorker.postMessage({buffer: buffer, width: width});
webWorker.onmessage = function( peaks ){
draw(peaks);
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.