From 42f231858ad594da6d4a2354479a9b1ea0e1d84a Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Mon, 30 Jan 2017 11:24:55 -0500 Subject: [PATCH] effects are managed by vm target and audio engine --- src/index.js | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/src/index.js b/src/index.js index 69d85f8..ec21178 100644 --- a/src/index.js +++ b/src/index.js @@ -189,51 +189,27 @@ AudioPlayer.prototype.setPitchEffect = function (value) { AudioPlayer.prototype.setEffect = function (effect, value) { switch (effect) { - case 'PITCH': - this.pitchEffect.set(value, this.soundPlayers); + case 'pitch': + this.pitchEffect.set(value, this.activeSoundPlayers); break; - case 'PAN': + case 'pan': this.panEffect.set(value); break; - case 'ECHO': + case 'echo': this.audioEngine.echoEffect.set(value); break; - case 'REVERB': + case 'reverb': this.audioEngine.reverbEffect.set(value); break; - case 'FUZZ' : + case 'fuzz' : this.audioEngine.fuzzEffect.set(value); break; - case 'ROBOT' : + case 'robot' : this.audioEngine.roboticEffect.set(value); break; } }; -AudioPlayer.prototype.changeEffect = function (effect, value) { - switch (effect) { - case 'PITCH': - this.pitchEffect.changeBy(value, this.soundPlayers); - break; - case 'PAN': - this.panEffect.changeBy(value); - break; - case 'ECHO': - this.audioEngine.echoEffect.changeBy(value); - break; - case 'REVERB': - this.audioEngine.reverbEffect.changeBy(value); - break; - case 'FUZZ' : - this.audioEngine.fuzzEffect.changeBy(value); - break; - case 'ROBOT' : - this.audioEngine.roboticEffect.changeBy(value); - break; - - } -}; - AudioPlayer.prototype.clearEffects = function () { this.panEffect.set(0); this.pitchEffect.set(0, this.activeSoundPlayers);