Running different sounds (outer-loop) while running Stroop Task (inner-loop)

OS Win11
PsychoPy version 2024.2.4
Standard Standalone Installation? (y/n) Y
Do you want it to also run online? (y/n) N
What are you trying to achieve?:
I want to examine how different background sounds affect cognitive performance. Specifically, I plan to play four different soundtracks, each followed by a Stroop task consisting of 40 trials (color-word combinations). The structure is as follows:

  1. A soundtrack begins.
  2. A Stroop task (40 trials) is executed while the soundtrack continues to play in the background.
  3. After the task ends, the next soundtrack starts, followed by another Stroop task.
  4. This repeats for all four soundtracks.

**What did you try to make it work?: *
I successfully created the Stroop task using an inner loop that reads word-color combinations from an xlsx file.
I also set up an outer loop that reads the list of four soundtracks from another xlsx file.
I added an introductory screen in the outer loop that announces the start of each new soundtrack and initiates the sound playback.
I want the soundtrack to continue playing during the Stroop task, but currently:
The sound starts on the “introduction” screen in the outer loop,
However, when the inner loop (Stroop task) begins, the sound stops or doesn’t continue.

What do I need help with?
How can I start the soundtrack once at the beginning of each block (i.e., once per outer loop), let it continue playing throughout the entire Stroop task, and only stop it after the 40 trials are completed, before the next soundtrack begins?

Link to the most relevant existing thread you have found: Is it possible to play continuous sound in Builder? - #4 by KSP

This might give you some pointers

Thanks for this. While this answer is not very clear to me, I’ll give it a try and come back with more questions. If there are other suggestions, please provide.

Finally, it turned out to be something very simple (thank you, PsychoPy!).
All I had to do was go to the properties of the sound object (in the SoundScreen at the beginning of the outer loop), navigate to the ‘Playback’ tab, and uncheck the ‘Stop with Routine?’ option.

That’s it — the sound continued playing while the inner loop ran. Once the inner loop finished, a new sound was played and the inner loop restarted as intended.

1 Like

Hi again,
I noticed that a detail is required in order for the sound to continue playing while the inner loop starts: