From 002a378d9775a172a956f9a4f0f1ec3d2d5fe79c Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Mon, 30 Jan 2017 11:25:43 -0500 Subject: [PATCH] soundplayers are explicitly connected to output node when created --- src/SoundPlayer.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/SoundPlayer.js b/src/SoundPlayer.js index 0783efe..4c32491 100644 --- a/src/SoundPlayer.js +++ b/src/SoundPlayer.js @@ -1,13 +1,16 @@ var Tone = require('tone'); var log = require('./log'); -function SoundPlayer (outputNode) { - this.outputNode = outputNode; +function SoundPlayer () { + this.outputNode; this.buffer; // a Tone.Buffer this.bufferSource; this.playbackRate = 1; this.isPlaying = false; } +SoundPlayer.prototype.connect = function (node) { + this.outputNode = node; +}; SoundPlayer.prototype.setBuffer = function (buffer) { this.buffer = buffer;