Skip to content

Instantly share code, notes, and snippets.

@mohayonao
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save mohayonao/39f29b071ef91994eb27 to your computer and use it in GitHub Desktop.

Select an option

Save mohayonao/39f29b071ef91994eb27 to your computer and use it in GitHub Desktop.
"use strict";
var AudioNode$connect = AudioNode.prototype.connect;
var AudioNode$disconnect = AudioNode.prototype.disconnect;
AudioNode.prototype.connect = connect;
AudioNode.prototype.disconnect = disconnect;
function connect(destination) {
var args = [].slice.call(arguments, 1);
if (typeof destination.__connectFrom === "function") {
destination.__connectFrom.apply(destination, [ this ].concat(args));
} else {
AudioNode$connect.apply(this, [ destination ].concat(args));
}
};
function disconnect() {
var args = [].slice.call(arguments);
if (args.length && typeof args[0].__disconnectFrom === "function") {
destination.__disconnectFrom.apply(destination, [ this ].concat(args.slice(1)));
} else {
AudioNode$disconnect.apply(this, args);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment