X-Git-Url: https://git.r.bdr.sh/rbdr/r.bdr.sh/blobdiff_plain/e6aee9be6b70daf4d3b4e0b1f0f41ce0626adaf0..b113804697383fd6c8ff5d499eae914dab8c535b:/jekyll/js/unlimited_pizza/pepperoni.js?ds=inline
diff --git a/jekyll/js/unlimited_pizza/pepperoni.js b/jekyll/js/unlimited_pizza/pepperoni.js
index 58bcc5f..c20f285 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 = ev.target;
+ console.log("Reverb loading");
+ this.context.decodeAudioData(request.response, function(buffer){
+ console.log("Reverb loaded");
+ this._convolverNode.buffer = buffer;
+ }.bind(this));
+ }.bind(this);
+
+ request = new XMLHttpRequest();
+ request.open('GET', '/reverb.ogg', true);
+ request.responseType = 'arraybuffer';
+ request.addEventListener('load', requestHandler, false);
+ request.send();
+
if (!this.source) {
this._getUserMedia({
audio : true