# HG changeset patch # User Nicholas Jillings # Date 1478698681 0 # Node ID 21110fddb0af7d7ea59c59fe6cd69bdd8b483a85 # Parent 70a319ff302e40168c2ae17d4ed226482c995e03 Fix for #159 diff -r 70a319ff302e -r 21110fddb0af js/core.js --- a/js/core.js Wed Nov 09 13:30:31 2016 +0000 +++ b/js/core.js Wed Nov 09 13:38:01 2016 +0000 @@ -1844,10 +1844,10 @@ this.outputGain.gain.cancelScheduledValues(audioContext.currentTime); if (!audioEngineContext.loopPlayback || !audioEngineContext.synchPlayback) { this.metric.startListening(audioEngineContext.timer.getTestTime()); - this.outputGain.gain.setValueAtTime(this.onplayGain, startTime); + this.outputGain.gain.linearRampToValueAtTime(this.onplayGain, startTime + specification.crossFade); this.interfaceDOM.startPlayback(); } else { - this.outputGain.gain.setValueAtTime(0.0, startTime); + this.outputGain.gain.linearRampToValueAtTime(0.0, startTime); } if (audioEngineContext.loopPlayback) { this.bufferNode.loopStart = this.specification.startTime || 0; @@ -1867,7 +1867,7 @@ this.bufferNode.stop(stopTime); this.bufferNode = undefined; } - this.outputGain.gain.setValueAtTime(0.0, stopTime); + this.outputGain.gain.linearRampToValueAtTime(0.0, stopTime); this.interfaceDOM.stopPlayback(); };