Mercurial > hg > webaudioevaluationtool
comparison ape.js @ 945:17561e292409
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 <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Sun, 24 May 2015 10:03:36 +0100 |
parents | 23bf5007b552 |
children | e50a0ea30326 |
comparison
equal
deleted
inserted
replaced
944:23bf5007b552 | 945:17561e292409 |
---|---|
480 audioEngineContext.metric.sliderMoveStart(id); | 480 audioEngineContext.metric.sliderMoveStart(id); |
481 }; | 481 }; |
482 | 482 |
483 // Onclick, switch playback to that track | 483 // Onclick, switch playback to that track |
484 trackSliderObj.onclick = function() { | 484 trackSliderObj.onclick = function() { |
485 // Start the test on first click, that way timings are more accurate. | |
486 audioEngineContext.play(); | |
485 // Get the track ID from the object ID | 487 // Get the track ID from the object ID |
486 var id = Number(this.id.substr(13,2)); // Maximum theoretical tracks is 99! | 488 var id = Number(this.id.substr(13,2)); // Maximum theoretical tracks is 99! |
487 audioEngineContext.metric.sliderPlayed(id); | 489 audioEngineContext.metric.sliderPlayed(id); |
488 audioEngineContext.selectedTrack(id); | 490 audioEngineContext.selectedTrack(id); |
489 // Currently playing track red, rest green | 491 // Currently playing track red, rest green |
494 { | 496 { |
495 document.getElementById('track-slider-'+i).style.backgroundColor = "rgb(100,200,100)"; | 497 document.getElementById('track-slider-'+i).style.backgroundColor = "rgb(100,200,100)"; |
496 } | 498 } |
497 | 499 |
498 } | 500 } |
499 audioEngineContext.play(); | |
500 }; | 501 }; |
501 | 502 |
502 canvas.appendChild(trackSliderObj); | 503 canvas.appendChild(trackSliderObj); |
503 | 504 |
504 }); | 505 }); |
728 { | 729 { |
729 // Start the test | 730 // Start the test |
730 var testId = currentState.substr(11,currentState.length-10); | 731 var testId = currentState.substr(11,currentState.length-10); |
731 currentState = 'testRun-'+testId; | 732 currentState = 'testRun-'+testId; |
732 //audioEngineContext.timer.startTest(); | 733 //audioEngineContext.timer.startTest(); |
733 audioEngineContext.play(); | 734 //audioEngineContext.play(); |
734 } else if (currentState.substr(0,11) == 'testRunPost') | 735 } else if (currentState.substr(0,11) == 'testRunPost') |
735 { | 736 { |
736 var testId = currentState.substr(12,currentState.length-11); | 737 var testId = currentState.substr(12,currentState.length-11); |
737 testEnded(testId); | 738 testEnded(testId); |
738 } else if (currentState.substr(0,7) == 'testRun') | 739 } else if (currentState.substr(0,7) == 'testRun') |