effects are managed by vm target and audio engine

This commit is contained in:
Eric Rosenbaum 2017-01-30 11:24:55 -05:00
parent 263f614ef8
commit 42f231858a

View file

@ -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);