As a component is contained within a routine, making one single component run across multiple routines is difficult, but not impossible!
The trick is to store the time taken at the end of each routine, then start the sound playing again from that same point at the start of every routine. You can do this using a Variable component: Set the value at experiment start to be 0
, then the variable at routine end to be its own name + t
. This means that the time each routine took will be added to the variable, so you can then use a Code component to tell the Sound component to start at this point like so:
mySoundComponent.start(when=myVariable)
(where mySoundComponent
is the name of your sound component and myVariable
is the name of your Variable component)
This would go in the Begin Routine
tab of the Code component.