Running a movie, sound and image stimuli in the same routine

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

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): 3
Standard Standalone? (y/n) If not then what?:Y
What are you trying to achieve?: I want to running movie, sound and image stimuli in the same routine

What did you try to make it work?:
I choose movie stimuli and create excel list with mp4, mp3 and .jpg files. And with this 3 kinds of stimuli excel list I create the experiment as normal.
Is it possible Run an experiment with image, sound and movie stimuli in the same routine with listing an one excel file?

What specifically went wrong when you tried that?: Out of index and OS errors

Include pasted full error message if possible. “That didn’t work” is not enough information.

Do you have any code or just the components?

I don’t think mp3 works for sounds locally. I find .ogg is the best (then .mp3 for online).

Best wishes,

Wakefield

1 Like

Now you’ve posted your Excel I can see you have everything in one column (called all ?)

I thought you were trying to put all three in the same loop but I now assume you want one of the three on each repeat.

In either case I’d recommend having a different column for each stimulus type. You could have a transparent one pixel png image, silent.ogg and empty.mp4 to fill the gaps if you want to avoid code.

Hi Wakefield,
could you please give me a hint how to implement this (use .ogg locally, but mp3 for online?) I currently have my sound file in .ogg. What code should I insert to use the mp3 format for online?
Henning

You could use a code_both component to specify different files for locally or online. Alternatively, you could have .mp3 file names in your Excel file and then have a Python code component to replace .mp3 with .ogg at the top of the routine that needs them.

excellent, I will try that

thanks again, this has worked. I have followed your second suggestion, and have inserted a Python only routine at the top of my trial routine. Maybe helpful for others as well. audioFile is the name of my soundfile in the excel conditions file

audioFile = audioFile.replace(".mp3",".ogg")