Psychopy builder: sound stimulus as variable

OS Win10
PsychoPy version 3.1.0
**Standard Standalone? y
**What are you trying to achieve?: **

Dear all,

We have a routine with a sound stimulus, which is read from our files through a variable. The starting and ending time of the sound are also variables. However, the sound is not playing in this case. There’s no error message coming out, just no sound.

However, when we hard code the sound stimulus (instead of a variable), it works. It seems the problem lies in using variables to read the sound file. Could someone let us know if there’s a solution to this?

Try updating to the latest version:
as this was fixed in 3.1.1 I believe

I have a similar problem. I use both sound files directly and sound files via variables. When I piloting the experiment on a Windows computer, everything works fine. The direct soundfile works on a Mac, but there is an error message that the variable cannot be found.

I am using Psychopy 2020.2.2

What can that be?

Show us how you are specifying the sound file locations.

the “direct soundfile”:

Dachs_laut = new sound.Sound({
win: psychoJS.window,
value: ‘Tone/Grundschulblog_Der_Dachs.wav’,
secs: (- 1),
key_resp_instr = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});

the sounds via variables:

Sound_PreClock = new util.Clock();
File_pre = new sound.Sound({
win: psychoJS.window,
value: ‘A’,
secs: (- 1),

var loop_pre;
var currentLoop;
function loop_preLoopBegin(thisScheduler) {
// set up handler to look after randomisation of conditions etc
loop_pre = new TrialHandler({
psychoJS: psychoJS,
nReps: 1, method: TrialHandler.Method.RANDOM,
extraInfo: expInfo, originPath: undefined,
trialList: ‘conditions_tone.xlsx’,
seed: undefined, name: ‘loop_pre’
psychoJS.experiment.addLoop(loop_pre); // add the loop to the experiment
currentLoop = loop_pre; // we’re now the current loop

Hope thats clear? Because i did eyerything with the builder.

grafik grafik

Are there any News? the experiment is working on my iphone but no sound is playing. Can anyone help?