Update audioseqq.js

parent 370e1608
......@@ -539,7 +539,6 @@ var frameRemains;
function SOUNDRoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'SOUND'-------
let continueRoutine = true; // until we're told otherwise
// get current time
t = SOUNDClock.getTime();
frameN = frameN + 1;// number of completed frames (so 0 is the first frame)
......@@ -550,17 +549,14 @@ function SOUNDRoutineEachFrame(snapshot) {
sound_1.tStart = t; // (not accounting for frame time here)
sound_1.frameNStart = frameN; // exact frame index
psychoJS.window.callOnFlip(function(){ sound_1.play(); }); // screen flip
sound_1.play(); // start the sound (it finishes automatically)
sound_1.status = PsychoJS.Status.STARTED;
}
frameRemains = durationn(intervall)[c] + stop(ran) - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if (sound_1.status === PsychoJS.Status.STARTED && t >= frameRemains) {
// if (stop(ran) > 0.5) {
sound_1.stop(); // stop the sound (if longer than duration)
if ((sound_1.status === PsychoJS.Status.STARTED || sound_1.status === PsychoJS.Status.FINISHED) && t >= frameRemains) {
if (stop(ran) > 0.5) { sound_1.stop(); // stop the sound (if longer than duration)
sound_1.status = PsychoJS.Status.FINISHED;
// }
}
}
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment