diff ape.js @ 1615:eefec889c62d

Bug #1225: Start button fix improved so audioEngine is in playing state before the audioObject set to play. More for timings and master gain.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Sun, 24 May 2015 10:03:36 +0100
parents 4f3ddd805ff3
children e50a0ea30326
line wrap: on
line diff
--- a/ape.js	Sun May 24 09:57:35 2015 +0100
+++ b/ape.js	Sun May 24 10:03:36 2015 +0100
@@ -482,6 +482,8 @@
 		
 		// Onclick, switch playback to that track
 		trackSliderObj.onclick = function() {
+			// Start the test on first click, that way timings are more accurate.
+			audioEngineContext.play();
 			// Get the track ID from the object ID
 			var id = Number(this.id.substr(13,2)); // Maximum theoretical tracks is 99!
 			audioEngineContext.metric.sliderPlayed(id);
@@ -496,7 +498,6 @@
                 }
                               
             }
-            audioEngineContext.play();
 		};
 		
 		canvas.appendChild(trackSliderObj);
@@ -730,7 +731,7 @@
 		var testId = currentState.substr(11,currentState.length-10);
 		currentState = 'testRun-'+testId;
 		//audioEngineContext.timer.startTest();
-		audioEngineContext.play();
+		//audioEngineContext.play();
 	} else if (currentState.substr(0,11) == 'testRunPost')
 	{
 		var testId = currentState.substr(12,currentState.length-11);