psychopy.org | Reference | Downloads | Github

Presenting two sound files one after another and conditionally starting mouse response component


#1

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10):
PsychoPy version (e.g. 1.83.x):
Dear all

I have two sound files (sound_3 and sound_4) to be presented in a same routine. I want the Sound_4 to start only after sound_3 has finished playing. Sound_3 files are varying in lengths so I cant setup a fixed starting time for Sound_4. Note, there are also two images on the screen.

I used the ‘sound_3.getDuration()’ at the stop duration(s) of ‘sound_3’ and used ‘$sound_3.status==FINISHED’ at the start time(s) of ‘sound_4’. This part seems to work. However, when I added the mouse component and code-component this seem to disturb this organization(I noticed that the sound_4 did not get played).

Also,

I wanted the ‘mouse_2’ component to start (i.e., I want the RT window to start) after the ‘sound_3’ is finished. Therefore, I set up a ‘sound_4.getDuration()’ at the stop duration(s) of ‘sound_4’ and used ‘$sound_4.status==FINISHED’ at the start time(s) of ‘mouse_2’.
The mouse click on one of the images ends the trial (which I wanted). At the moment it still ends the trial but the RT is too high, which suggest that the mouse is activated even before the end of sound_4. Furthermore, I observed that if I click the mouse even before the sound_4 has started, it ends the trial, which, confirms the problem with starting of the mouse component.

How to fix this so the mouse gets started after completion of sound_4?

Any help is appreciated
Kuppu


#2

sound_4.status == FINISHED is an expression which yields a result of either 0 (False) or 1 (True). You have set the start of your mouse component to be a time rather than a condition, so it will start at 0 seconds.

Change this field to be a condition rather than a time.


#3

Dear Michael

Thanks I set changed them to condition. Now the sounds play perfectly one after another. However, the mouse still gets activated while the sound_3 / sound_4 is still playing. I have set the mouse component as condition and incorporated ‘sound_4.status==FINISHED’ at the start.

How to make sure that the mouse starts only after the sound_4 is finished playing ?

Thanks


#4

Hello there

I am still struggling with the earlier problem. Can anybody help?

Thanks