Easy sound reactivity for Chrome/Webkit
JavaScript CoffeeScript
Latest commit e04bfaf Jul 18, 2013 @davidguttman client fix
Permalink
Failed to load latest commit information.
build packaging for npm May 8, 2013
demo packaging for npm May 8, 2013
lib client fix Jul 19, 2013
src client fix Jul 19, 2013
.gitignore adding gitignore Apr 3, 2012
README.md added notes to readme Apr 3, 2012
index.js packaging for npm May 8, 2013

README.md

EasyEars.js

Easy sound reactivity for Chrome (and Safari nightly?).

Demo page

Getting Started

First, get the code.

Second, create a new instance of EasyEars with the form:

new EasyEars(options, completeCallback);

Here are some examples:

// Create a new ears instance that will use a DOM
// element as a target for drag and dropped .mp3
ears = new EasyEars({dropTarget: document}, function(){
  console.log('song loaded!');
});

// or...

// Create one that will use an mp3 from a url
ears = new EasyEars({url: '/mp3/a_song.mp3'});

To use it, first update the audio using updateAudio(timeSmoothing). Where timeSmoothing is a value between 0.0 and 1.0.

Next, use ears.lows(), ears.mids(), and ears.highs() to get sound data back from EasyEars. These values will always be between 0.0 and 1.0.

Usage Examples:

var animate = function() {
  webkitRequestAnimationFrame(animate);

  // call updateAudio periodically to get latest sound data
  ears.updateAudio(0.5);

  // use the following methods to get sound data,
  // each will return a value between 0.0 and 1.0
  ears.lows();
  ears.mids();
  ears.highs();
}