Mercurial > hg > webaudioevaluationtool
changeset 2351:e157b2b88219
Fix for #13. Synchronous playback and looped playback are different things.
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Mon, 16 May 2016 11:24:40 +0100 |
parents | 7de03d416f38 |
children | 76a4878d0f1f |
files | js/core.js |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/js/core.js Mon May 16 10:48:29 2016 +0100 +++ b/js/core.js Mon May 16 11:24:40 2016 +0100 @@ -1192,6 +1192,8 @@ this.metric = new sessionMetrics(this,specification); this.loopPlayback = false; + this.synchPlayback = false; + this.pageSpecification = null; this.pageStore = null; @@ -1399,7 +1401,8 @@ } else { interfaceContext.playhead.setTimePerPixel(this.audioObjects[id]); } - if (this.loopPlayback) { + if (this.synchPlayback && this.loopPlayback) { + // Traditional looped playback var setTime = audioContext.currentTime+specification.crossFade; for (var i=0; i<this.audioObjects.length; i++) { @@ -1410,7 +1413,7 @@ this.audioObjects[i].loopStop(setTime); } } - } else { + } else { var setTime = audioContext.currentTime+specification.crossFade; for (var i=0; i<this.audioObjects.length; i++) { @@ -1481,6 +1484,7 @@ this.newTestPage = function(audioHolderObject,store) { this.pageStore = store; + this.pageSpecification = audioHolderObject; this.status = 0; this.audioObjectsReady = false; this.metric.reset(); @@ -1491,6 +1495,7 @@ this.audioObjects = []; this.timer = new timer(); this.loopPlayback = audioHolderObject.loop; + this.synchPlayback = audioHolderObject.synchronous; }; this.checkAllPlayed = function() { @@ -1645,7 +1650,7 @@ event.currentTarget.owner.stop(audioContext.currentTime+1); } }; - if (this.bufferNode.loop == false) { + if (!audioEngineContext.loopPlayback || !audioEngineContext.synchPlayback) { this.metric.startListening(audioEngineContext.timer.getTestTime()); this.outputGain.gain.setValueAtTime(this.onplayGain,startTime); this.interfaceDOM.startPlayback();