psychopy.org | Reference | Downloads | Github

Advancing to the next component when an audio is finished playing

OS (e.g. Win10): macOS Mojave 10.14.5
PsychoPy version (e.g. 1.84.x): 3.2.4
Standard Standalone? (y/n) y

What are you trying to achieve?:
I am trying to set up an ABX task where ABX are referred as three different sound files. A completion of ABX is one trial. In the beginning of each trial. A fixation is presented for 150 ms and then followed by “A”. The duration of the A is set to be the inherent duration of the sound file. After A, an ISI of 300 ms is added. B starts after the 300 ms pause. The duration of B is also set to be the inherent duration of the sound file and is followed by another ISI of 300 ms when finished playing. X will be played after the 300 ms pause and will be played for the inherent duration of the sound file.

What did you try to make it work?:
I saw that I don’t have to specify the stop time for the Sound component. This way, it will advance to the next component (in this case, an ISI of 300 ms) when the sound is finished playing. However, in order to add the ISI component, I have to set a start time. Is there a way to set the start time to be when the previous sound file is finished instead of a fixed start time? In other words, I don’t really know how to advance to the next component when it has to depend on the inherent duration of a sound file.

What specifically went wrong when you tried that?:
Nothing went wrong specifically, I was able to build the experiment. However, the timing is not correct (see above for the desired timing)

I am attaching a working minimal example as well as the sound files. I would greatly appreciate your help!

perception.psyexp (11.1 KB) test.xlsx (8.5 KB)

For your ISI component, choose one which can have its start set to “condition” rather than just a time value. Then you can put something like:

your_sound_component_name.status == FINISHED
1 Like

@Michael Thank you so much! this worked! I appreciate your help!!