Using Psychopy2, I am trying to present a movie using moviestim2 and a rating scale using ratingScale in the same window concurrently so that participants can continuously rate the video in terms of their subjective experience.
However, I have found that whenever the same window is used to do this, the video becomes very dark and flickers lots.
When I present them seperately and using different windows this is not a problem.
If anyone has come across this issue and overcome it, I would appreciate some advice.
Here is the code I have been working on:
filmDict = data.TrialHandler(nReps = 1, method = 'sequential', trialList = data.importConditions('filmList.csv'), name = 'filmList') # dictionary containing film names
TimingsDict ={'Participant_number': part_number} # dictionary for the data to be entered into the 'timings.csv' file
#Creates fullscreen black window for stimuli to be presented on throughout task.
win = visual.Window([1024, 768], fullscr = False, allowGUI = True,
units = "pix", color = (1,1,1))
# Creates text stimuli to be updated on each trial.
stim = visual.TextStim(win, "")
#Presents ready screen at the start of practice trials.
stim.setText("Press Enter to begin.")
stim.color = (-1,-1,-1)
stim.draw()
win.flip()
#create a RatingScale object:
myRatingScale = visual.RatingScale(win, choices=['Uncertainty','Certainty']) # creates rating scale
# the item to-be-rated or respond to:
myItem = visual.TextStim(win, text="Please continuously rate the amount of uncertainty felt", height=.12, units='norm')
event.clearEvents()
myItem.draw()
myRatingScale.draw()
win.flip()
if event.getKeys(['escape']):
core.quit()
#Start a clock right before the experiment starts
tasktime = core.Clock()
tasktime.reset()
for film in filmDict:
start =time.time()
#videoStart = strftime("%H:%M:%S", gmtime())
videoStart = tasktime.getTime()
mov = visual.MovieStim2(win, film[videoCondition], size=(564, 360), flipVert=False, flipHoriz=False, loop=False)
while mov.status != visual.FINISHED:
mov.draw()
win.flip()
#videoEnd = strftime("%H:%M:%S", gmtime())
videoEnd = tasktime.getTime()
#qEnd=strftime("%H:%M:%S", gmtime())
qEnd = tasktime.getTime()
end =time.time()
trial_duration = (end-start)