BF: Sound online was sometimes marked as already finished on second iteration of a loop#7016
Merged
TEParsons merged 1 commit intopsychopy:devfrom Dec 18, 2024
Merged
Conversation
…teration of a loop
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #7016 +/- ##
==========================================
- Coverage 50.96% 41.66% -9.30%
==========================================
Files 340 340
Lines 62332 62334 +2
==========================================
- Hits 31769 25973 -5796
- Misses 30563 36361 +5798
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the sound finished playing in the first iteration, it gets
isFinished = true. If the Component reached its stop point, it gets.status = FINISHED(one referring to the sound itself, the second referring to the Sound Component). As with all Components, it gets.status = NOT_STARTEDwhen the next iteration begins, but.isFinishedis never set back tofalse.An example of an incongruency:
You have a Sound Component called
sndwith duration set to 5s, it plays a sound file which is 2s long. After 2s, the sound finishes andsnd.isFinished = true. After 5s, the Component finishes andsnd.status = FINISHED. Next iteration of the trials loop,snd.status = NOT_STARTED(correctly, as we haven't played anything yet), butsnd.isFinished = truebecause that wasn't automatically reset.This solution means that a Sound always starts a Routine with
isFinished = false