diff --git a/parcel/lib/audio-manager.js b/parcel/lib/audio-manager.js index d314a85..79fd02b 100644 --- a/parcel/lib/audio-manager.js +++ b/parcel/lib/audio-manager.js @@ -60,6 +60,7 @@ export default class AudioManager{ /* (7) Initialise coordinator to manage received */ this.stack = []; + this.stack_save = 0; @@ -291,7 +292,7 @@ export default class AudioManager{ gain.connect(this.master); /* (7) If not empty stack -> play stack */ - if( this.stack.length > 0 ){ + if( this.stack.length > this.stack_save ){ this.stack.shift().start(this.ctx.currentTime); return this.stack.push(source); } @@ -304,11 +305,12 @@ export default class AudioManager{ this.dbg.data.packets_received++; this.dbg.data.kB_received += _buffer.length * 16. / 8 / 1024; - return this.stack.length > 0 && this.stack.shift().start(this.ctx.curentTime); + if( this.stack.length > this.stack_save ) + this.stack.shift().start(this.ctx.curentTime); }.bind(this); - // start playing + // push in stack source.start(this.ctx.currentTime); }