mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 08:17:07 +00:00
use the jsNode buffer size instead of the global one
This commit is contained in:
parent
9e4075b90e
commit
f156f6310a
2 changed files with 5 additions and 5 deletions
|
@ -59,7 +59,7 @@ AudioUnit.Meter.prototype.isClipped = function(){
|
|||
|
||||
//get the max value
|
||||
AudioUnit.Meter.prototype.onprocess = function(event){
|
||||
var bufferSize = this.bufferSize;
|
||||
var bufferSize = this.jsNode.bufferSize;
|
||||
for (var channel = 0; channel < this.channels; channel++){
|
||||
var input = event.inputBuffer.getChannelData(channel);
|
||||
var sum = 0;
|
||||
|
|
|
@ -44,7 +44,7 @@ AudioUnit.Noise.prototype._pinkNoise = (function() {
|
|||
var b0, b1, b2, b3, b4, b5, b6;
|
||||
b0 = b1 = b2 = b3 = b4 = b5 = b6 = 0.0;
|
||||
return function(e) {
|
||||
var bufferSize = this.bufferSize;
|
||||
var bufferSize = this.jsNode.bufferSize;
|
||||
var output = e.outputBuffer.getChannelData(0);
|
||||
for (var i = 0; i < bufferSize; i++) {
|
||||
var white = Math.random() * 2 - 1;
|
||||
|
@ -65,7 +65,7 @@ AudioUnit.Noise.prototype._pinkNoise = (function() {
|
|||
AudioUnit.Noise.prototype._brownNoise = (function() {
|
||||
var lastOut = 0.0;
|
||||
return function(e) {
|
||||
var bufferSize = this.bufferSize;
|
||||
var bufferSize = this.jsNode.bufferSize;
|
||||
var output = e.outputBuffer.getChannelData(0);
|
||||
for (var i = 0; i < bufferSize; i++) {
|
||||
var white = Math.random() * 2 - 1;
|
||||
|
@ -79,8 +79,8 @@ AudioUnit.Noise.prototype._brownNoise = (function() {
|
|||
|
||||
//modified from http://noisehack.com/generate-noise-web-audio-api/
|
||||
AudioUnit.Noise.prototype._whiteNoise = function(e){
|
||||
var bufferSize = this.bufferSize;
|
||||
var output = e.outputBuffer.getChannelData(0);
|
||||
var bufferSize = this.jsNode.bufferSize;
|
||||
var output = e.outputBuffer.getChannelData(0);
|
||||
for (var i = 0; i < bufferSize; i++) {
|
||||
output[i] = Math.random() * 2 - 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue