From: Ben Beltran Date: Wed, 25 Feb 2015 14:08:21 +0000 (-0600) Subject: Adds weird reverb code X-Git-Url: https://git.r.bdr.sh/rbdr/r.bdr.sh/commitdiff_plain/18fa1c7b863366a2b08dca4cfc11e9ec2b92ebf3?hp=--cc Adds weird reverb code --- 18fa1c7b863366a2b08dca4cfc11e9ec2b92ebf3 diff --git a/jekyll/js/unlimited_pizza/pepperoni.js b/jekyll/js/unlimited_pizza/pepperoni.js index 58bcc5f..9bb27a2 100644 --- a/jekyll/js/unlimited_pizza/pepperoni.js +++ b/jekyll/js/unlimited_pizza/pepperoni.js @@ -1,3 +1,5 @@ +'use strict'; + Class(UnlimitedPizza, "Pepperoni").inherits(Widget)({ INNER_HTML : ' \ \ @@ -13,6 +15,7 @@ Class(UnlimitedPizza, "Pepperoni").inherits(Widget)({ \ \ \ + \ \ \ \ @@ -34,6 +37,8 @@ Class(UnlimitedPizza, "Pepperoni").inherits(Widget)({ _activatedNodes : null, workerPath : '/js/vendor/recorderjs/recorderWorker.js', init : function init(config) { + var channels, frameCount, reverbBuffer, request, requestHandler; + Widget.prototype.init.call(this, config); if (!this.context) { @@ -67,6 +72,21 @@ Class(UnlimitedPizza, "Pepperoni").inherits(Widget)({ this._bandPassFilterNode.frequency.value = 2000; this._bandPassFilterNode.gain.value = 25; + requestHandler = function bufferFile(ev) { + var request = event.target; + console.log("Reverb loading"); + this.context.decodeAudioData(request.response, function(buffer){ + console.log("Reverb loaded"); + this._convolverNode.buffer = buffer; + }); + }.bind(this); + + request = new XMLHttpRequest(); + request.open('GET', '/reverb.aiff', true); + request.responseType = 'arraybuffer'; + request.addEventListener('load', requestHandler, false); + request.send(); + if (!this.source) { this._getUserMedia({ audio : true diff --git a/jekyll/reverb.aiff b/jekyll/reverb.aiff new file mode 100644 index 0000000..54226d5 Binary files /dev/null and b/jekyll/reverb.aiff differ