sccn / labstreaminglayer

LabStreamingLayer super repository comprising submodules for LSL and associated apps.
Other
522 stars 157 forks source link

problem with timing in python and psychopy: recording a video and audio and showing a circle and sending a marker to EEG #120

Open Niloofar-GH opened 1 month ago

Niloofar-GH commented 1 month ago

Hi,

In my script, I show a text "press s to start and press f to finish the experiment". when I press s key the audio and video recording start at the same time ( I am recording my screen with one webcam ) and then I show one green circle with the duration of one second just one time and at the same time I want to send a trigger to EEG so I tried the script and it worked:

Screenshot (1)

but there is one problem after running my script. I saw the recorded video. This recorded video is related to screen that shows the circle. I saw that the video recording start with delay and I cannot see the green circle flashing on the screen and I understood that I have to make a delay it means that when I press the s start the first audio and video recording and then set one second delay and then show the green circle and send the trigger to the EEG so therefore when I see the recorded video at the end of my script I can see the green circle on the recorded video. So I changed my while loop to the format below:

Screenshot (2)

it works now. It means when I see the recorded video I can see the text "press s to start and press f to finish the experiment" and after less than one second I can see a green circle but the problem is that I can not chang the timing of the delay. It means that when I set psy.core.wait to 0.030 (less than one seond), in my recorded video the timing of the delay is the same.

Do you have any ideas how can I solve this issue?

Thank you