Randomly Presenting images with randomly presented audio
Hi,
I am currently building an experiment in which I would like to present images, but while these images are displayed there are 1 of 3 audio tracks played randomly in the background. Does OS allow for the incorporation of audio during visual presentation?
Thanks!
Comments
What I mean is, Can I play an audio file while an image is presented and have them both stop when a response is recorded?
Hi @Tpatrick ,
This is possible, either directly with Python coding (within an inline_script), or using co-routines. I recommend you look at the latter:
Eduard
Ok, I am in the process of setting up the co-routine function, but I have 3 different sound files that I want to randomly assign to 96 different image files. The sampler seems to only allow for the playing of 1 sound file. Can you tell me how I might randomly select 1 of the 3 sound files for each trial?
Ok, So I figured out the sound issue. What I am running into now is that the sound/image doesn't stop when I press the appropriate key. I am not sure what needs to be adjusted to allow the trial to end when a key is pressed.
And when I get the experiment to move onto the next trial with a keypress, the sound from the previous trial continues in the background
So it looks like the co-routine function dictates the timing of each paired stimuli presentation. My question is, how do I get the trial (paired image and sound) to end when a key is pressed? Thanks!