Created
April 5, 2015 06:19
-
-
Save notthetup/533d08eb5a2d234b3d14 to your computer and use it in GitHub Desktop.
ScopeNode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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