changeset 131:67cc1058bfad

Possible fix to loop playback bugs
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Wed, 27 May 2015 18:10:56 +0100
parents cf5653a90c20
children 76d6207784a6
files ape.js core.js
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ape.js	Wed May 27 16:46:43 2015 +0100
+++ b/ape.js	Wed May 27 18:10:56 2015 +0100
@@ -343,7 +343,6 @@
 		loopPlayback = false;
 	}
 	audioEngineContext.loopPlayback = loopPlayback;
-	loopPlayback = false;
 	// Create AudioEngine bindings for playback
 	if (loopPlayback) {
 		audioEngineContext.selectedTrack = function(id) {
--- a/core.js	Wed May 27 16:46:43 2015 +0100
+++ b/core.js	Wed May 27 18:10:56 2015 +0100
@@ -432,6 +432,11 @@
 			}
 			if (this.audioObjectsReady == true) {
 				this.timer.startTest();
+				if (this.loopPlayback) {
+					for(var i=0; i<this.audioObjects.length; i++) {
+						this.audioObjects[i].play(this.timer.getTestTime()+1);
+					}
+				}
 				this.status = 1;
 			}
 		}