Skip to content

Instantly share code, notes, and snippets.

@notthetup
Created April 5, 2015 06:19
Show Gist options
  • Save notthetup/533d08eb5a2d234b3d14 to your computer and use it in GitHub Desktop.
Save notthetup/533d08eb5a2d234b3d14 to your computer and use it in GitHub Desktop.
ScopeNode
var scopeNode = context.createScriptProcessor();
scopeNode.onaudioprocess= function (ev){
var ch1Data = ev.inputBuffer.getChannelData(0);
var max = -2;
for(i=0; i<1024; i++){
if (ch1Data[i] > max){
max = ch1Data[i];
}
}
console.log(max);
}
scopeNode.connect(context.destination);
_scaler.connect(scopeNode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment