alemangui / pizzicato

Library to simplify the way you create and manipulate sounds with the Web Audio API.
https://alemangui.github.io/pizzicato/
MIT License
1.67k stars 132 forks source link

Incompatible with other js audio libs... #137

Open stramanu opened 4 years ago

stramanu commented 4 years ago

The shim makes the library incompatible with other audio libraries ... Another way would be needed to solve this need.

...
/* In order to allow an AudioNode to connect to a Pizzicato 
Effect object, we must shim its connect method */
var gainNode = Pizzicato.context.createGain();
var audioNode = Object.getPrototypeOf(Object.getPrototypeOf(gainNode));
var connect = audioNode.connect;

audioNode.connect = function(node) {
    var endpoint = Pz.Util.isEffect(node) ? node.inputNode : node;
    connect.call(this, endpoint);
    return node;
};
...
stramanu commented 4 years ago

Fixed in this pull request => #135