Commit 0c02b111 authored by Jakub Fiala's avatar Jakub Fiala

added back the setBufferSize method

parent a2a106f8
...@@ -33371,7 +33371,7 @@ maximJs.maxiAudio = function() { ...@@ -33371,7 +33371,7 @@ maximJs.maxiAudio = function() {
this.source = null; this.source = null;
this.analyser = null; this.analyser = null;
this.jsProcessor = null; this.jsProcessor = null;
this.bufferSize = 1024;
this.initDone = false; this.initDone = false;
}; };
...@@ -33397,6 +33397,12 @@ maximJs.maxiAudio.prototype.setNumChannels = function(isArray, numChannels_){ ...@@ -33397,6 +33397,12 @@ maximJs.maxiAudio.prototype.setNumChannels = function(isArray, numChannels_){
this.resetAudio(); this.resetAudio();
}; };
maximJs.maxiAudio.prototype.setBufferSize = function(newBufferSize) {
this.bufferSize = newBufferSize;
this.resetAudio();
};
// use this if you want to keep num of outputs but change // use this if you want to keep num of outputs but change
// method e.g. array or not // method e.g. array or not
maximJs.maxiAudio.prototype.outputIsArray = function(isArray){ maximJs.maxiAudio.prototype.outputIsArray = function(isArray){
...@@ -33416,7 +33422,7 @@ maximJs.maxiAudio.prototype.init = function() { ...@@ -33416,7 +33422,7 @@ maximJs.maxiAudio.prototype.init = function() {
this.context = new (window.AudioContext || window.webkitAudioContext)(); this.context = new (window.AudioContext || window.webkitAudioContext)();
this.source = this.context.createBufferSource(); this.source = this.context.createBufferSource();
this.jsProcessor = this.context.createScriptProcessor(4096, this.numChannels, this.numChannels); this.jsProcessor = this.context.createScriptProcessor(this.bufferSize, this.numChannels, this.numChannels);
// var process = this.process; // var process = this.process;
this.jsProcessor.onaudioprocess = function(event) { this.jsProcessor.onaudioprocess = function(event) {
...@@ -203,7 +203,7 @@ maximJs.maxiAudio = function() { ...@@ -203,7 +203,7 @@ maximJs.maxiAudio = function() {
this.source = null; this.source = null;
this.analyser = null; this.analyser = null;
this.jsProcessor = null; this.jsProcessor = null;
this.bufferSize = 1024;
this.initDone = false; this.initDone = false;
}; };
...@@ -229,6 +229,11 @@ maximJs.maxiAudio.prototype.setNumChannels = function(isArray, numChannels_){ ...@@ -229,6 +229,11 @@ maximJs.maxiAudio.prototype.setNumChannels = function(isArray, numChannels_){
this.resetAudio(); this.resetAudio();
}; };
maximJs.maxiAudio.prototype.setBufferSize = function(newBufferSize) {
this.bufferSize = newBufferSize;
this.resetAudio();
};
// use this if you want to keep num of outputs but change // use this if you want to keep num of outputs but change
// method e.g. array or not // method e.g. array or not
maximJs.maxiAudio.prototype.outputIsArray = function(isArray){ maximJs.maxiAudio.prototype.outputIsArray = function(isArray){
...@@ -248,7 +253,7 @@ maximJs.maxiAudio.prototype.init = function() { ...@@ -248,7 +253,7 @@ maximJs.maxiAudio.prototype.init = function() {
this.context = new (window.AudioContext || window.webkitAudioContext)(); this.context = new (window.AudioContext || window.webkitAudioContext)();
this.source = this.context.createBufferSource(); this.source = this.context.createBufferSource();
this.jsProcessor = this.context.createScriptProcessor(4096, this.numChannels, this.numChannels); this.jsProcessor = this.context.createScriptProcessor(this.bufferSize, this.numChannels, this.numChannels);
// var process = this.process; // var process = this.process;
this.jsProcessor.onaudioprocess = function(event) { this.jsProcessor.onaudioprocess = function(event) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment