I’m new to Psychopy. I’m trying to randomly play videos from a specific folder.
I understand that I should create an excel file, and refer to it in the loop under the field “conditions”. Then, under properties of my “movie stimulus”, in “movie file”, I can call my movie directly from my excel file, by writing $file. File is the variable in which I stored the paths of my videos.
That should be it. But when I run the experiment I get the following error:
“TypeError: coercing to Unicode: need string or buffer, type found”
In your excel file, uploaded under “conditions” of your loop, you should have a column called “vid”. In “vid” you need to place the exact paths to your videos
Slight addendum is that where WalkerF says “place the exact paths to your videos” I’d strongly recommend you place “relative” paths i.e. the location of the video relative to the experiment file (*.psyexp).
See chapter 3 of Building Experiments in PsychoPy for more information about filenames in conditions files