Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Easy sound reactivity for Chrome/Webkit

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 build
Octocat-spinner-32 demo
Octocat-spinner-32 lib
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 index.js
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();
}
Something went wrong with that request. Please try again.