Commit 05943e12 authored by Mick Grierson's avatar Mick Grierson

added buffersize method

parent 14461d94
......@@ -33508,6 +33508,7 @@ maximJs.maxiTools.loadSample = function(url, samplePlayer, contextIn) {
// });
maximJs.maxiAudio = (function() {
var numChannels = 2;
var bufferSize = 1024;
var output = 0;
this.context = null;
this.source = null;
......@@ -33526,6 +33527,10 @@ maximJs.maxiAudio = (function() {
this.outputIsArray(isArray, numChannels_);
this.resetAudio();
});
this.setBufferSize = (function(newBufferSize) {
bufferSize = newBufferSize;
this.resetAudio();
});
this.outputIsArray = (function(isArray) {
if (isArray) {
maximJs.maxiAudio.output = new Array(numChannels);
......@@ -33563,7 +33568,7 @@ maximJs.maxiAudio = (function() {
this.init = (function() {
this.context = new (window.AudioContext || window.webkitAudioContext);
this.source = this.context.createBufferSource();
this.jsProcessor = this.context.createScriptProcessor(4096, numChannels, numChannels);
this.jsProcessor = this.context.createScriptProcessor(bufferSize, numChannels, numChannels);
this.jsProcessor.onaudioprocess = process;
this.analyser = this.context.createAnalyser();
this.analyser.fftSize = 2048;
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