How to rename the microphone .wav file with the stimulus name?

Hello, I was trying to collect data with the microphone component with stimulus presented in a loop.
The wav. file I got was named with date and time, but I want it to be named with the stimuli presented in the same loop.

something like filename = $stimuli

I tried the

mic_1.setFile("someStringOfYourChoosing")

but it does not works for my case.

May I know how can I rename the wav. file?

Thank you

Does this post help?

sorry that I am not familiar with coding, may I know how does this code works?
if I want the file to be name like the stimuli name in the excel file i provide to the loop, should I edit this code with the variables in the coder? or should it be referred to some other component i have in the builder?

Thank you so much!

I’m not that familiar with it myself, but it looks like I’ve used %d to mark the positions of numbers and %s to mark the positions of strings. The variables to use in those positions are in brackets separated by commas. The original filename doesn’t have brackets because it only uses one variable (,tag).