soundplayers are explicitly connected to output node when created

This commit is contained in:
Eric Rosenbaum 2017-01-30 11:25:43 -05:00
parent 42f231858a
commit 002a378d97

View file

@ -1,13 +1,16 @@
var Tone = require('tone'); var Tone = require('tone');
var log = require('./log'); var log = require('./log');
function SoundPlayer (outputNode) { function SoundPlayer () {
this.outputNode = outputNode; this.outputNode;
this.buffer; // a Tone.Buffer this.buffer; // a Tone.Buffer
this.bufferSource; this.bufferSource;
this.playbackRate = 1; this.playbackRate = 1;
this.isPlaying = false; this.isPlaying = false;
} }
SoundPlayer.prototype.connect = function (node) {
this.outputNode = node;
};
SoundPlayer.prototype.setBuffer = function (buffer) { SoundPlayer.prototype.setBuffer = function (buffer) {
this.buffer = buffer; this.buffer = buffer;