I’m building an experiment in which participants (verbally) name pictures presented onscreen, and their responses are detected by a nearby microphone. I have a code component which saves each response as a separate audio file:
**note the pictures are pulled from an excel file, and ‘english_word’ is just the label given to each picture.
My problem is that I have multiple repetitions of each picture within my loop, meaning that when a picture is repeated, the previous audio file for that picture is overridden. Is there a way to specify the repetition/trial number for the output file, so that a separate file is generated for each iteration of each picture? Any help would be appreciated!
Thanks for the help! Unfortunately I have multiple loops (with different names) which all use the same routine (and hence, the same lines of code). Is it possible to do what you suggest in a way that generalises to all of my loops?
And the error message suggests, you need to make sure that the routine is within a loop called practiceTrials.
Your previous messages suggest that you’re wanting a way to refer to a generic loop name instead of a specific one, though. It’s hard to give advice without you telling us exactly what you are doing, and ideally giving a screenshot of your flow panel.
Thanks again for the input. Fortunately I found a workaround to my problem. Technically I didn’t really need to specify thisN, I just needed a way to distinguish between each individual trial. I ended up adding str(core.getTime()) to my output file path, so that now each trial generates a unique filename. It’s not very elegant but it works