Skip to content

Commit 3ba4440

Browse files
Reorganized the audio node structure of abstract audio wrapper so that effects no longer bypass mutes
1 parent 5ffbd51 commit 3ba4440

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/AbstractAudioWrapper.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ export default class AbstractAudioWrapper extends EventDispatcher{
3636
super();
3737
let ctx = Sound.context;
3838

39-
this.outputNode = this.volumeNode = ctx.createGain();
39+
this.fxBus = ctx.createGain();
4040

4141
this.panNode = this.postFxNode = ctx.createPanner();
42-
this.panNode.connect(this.outputNode);
4342

4443
this.declickerNode = ctx.createGain();
4544
this.declicker = new Declicker(this.declickerNode);
4645
this.declicker.on("fadeOutComplete", this.handleDeclickFadeoutComplete, this);
4746

4847
this.muterNode = ctx.createGain();
49-
this.muterNode.connect(this.outputNode);
5048
this._muted = false;
5149
this._muting = false;
5250

53-
this.fxBus = ctx.createGain();
54-
this.fxBus.connect(this.declickerNode);
51+
this.outputNode = this.volumeNode = ctx.createGain();
52+
53+
this.fxBus.connect(this.postFxNode); // No effects to start
54+
this.postFxNode.connect(this.declickerNode);
5555
this.declickerNode.connect(this.muterNode);
5656
this.muterNode.connect(this.outputNode);
5757

0 commit comments

Comments
 (0)