I want to present and image in the backround while playing several audio files.
I wrote 2 simple functions, the first returns an imageStim object for the background, the second builds a player object using the package Pyglet and play a sequence of audio files.
the problem is that the background image is flickering.
what should I change?
thanks a lot
def backround_stp(win): str_cross = "./input/graphics/instructions/Slide3.JPG" cross = visual.ImageStim(win=win,image=str_cross, units='pix') return cross def play_stp(win,neuORneg): sound_path = "input/Audio" dir_audio = os.listdir(sound_path) player = pg.media.Player() half_stp = int(len(dir_audio)/2) if neuORneg=='neu': s,f=0,half_stp+1 else: #neg s,f=half_stp+1,len(dir_audio)+1 for index_str_audio in range(s,f): music = pg.resource.media(sound_path + '/' + dir_audio[index_str_audio], streaming=False) player.queue(music) cross =backround_stp(win) time = player.time **cross.autoDraw = True** win.flip() player.play() pg.app.run() **cross.autoDraw = False** win.close() win = window() play_stp(win,'neu')
This text will be blurred