Skip to content

Instantly share code, notes, and snippets.

@skycocker
Created October 7, 2013 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skycocker/6874522 to your computer and use it in GitHub Desktop.
Save skycocker/6874522 to your computer and use it in GitHub Desktop.
Whistle.js analyser snippet
var frequencies = new Uint8Array(analyser.frequencyBinCount);
analyser.getByteFrequencyData(frequencies);
for(var i=25; i<=80; ++i) {
if(frequencies[i] > 250) document.dispatchEvent(whistleEvent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment