Giter Site home page Giter Site logo

analyzer's Introduction

analyzer

A multi channel WebAudio analyzer that does all the nasty plumbing with JavaScriptSourceNodes and AnalyzerNodes for you.

Example

Analyze the input stream from your computer's microphone and log results to the console:

var Analyzer = require('analyzer');
var AudioContext = window.audioContext || window.webkitAudioContext;

var context = new AudioContext();
var analyzer = Analyzer(context)
  .add('left', source, 0)
  .add('right', source, 1);

analyzer.on('float frequency data', function(chunk) {
  console.log('float frequency data', chunk);
  // { left: [ ... ], right: [ ... ] }
});

Installation

Install with component(1):

$ component install juliangruber/analyzer

API

Analyzer([opts, ]ctx)

Create a new Analyzer for the WebAudio context. Inherits from component/emitter.

Possible options:

  • smoothing: The smoothing time constant, can be between 0 and 1.

Analyzer#add(name, node[, channel])

Start analyzing node and expose it in events under name. channel is the output channel you care about and defaults to 0.

Analyzer#resume()

Resume analyzing.

Analyzer#pause()

Pause analyzing.

Analyzer#on('float frequency data', fn)

Call fn with a Float32Array(fftSize / 2) for each new chunk.

Analyzer#on('byte frequency data', fn)

Call fn with a Uint8Array(fftSize / 2) for each new chunk.

Analyzer#on('byte time domain data', fn)

Call fn with a Float32Array(fftSize) for each new chunk.

License

MIT

analyzer's People

Contributors

juliangruber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

analyzer's Issues

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.