PsychoPy 2026.1.3, macos tahoe 26.4.1, Safari browser
A Sound component with a dynamic value ($voice_context, set every repeat) works correctly in local PsychoPy but fails to play online. The sound property dropdown is grayed out in Builder despite the variable syntax being correct.
Inspecting the .psyexp file directly confirms updates=“set every repeat” is set correctly, so the gray dropdown appears to be a display bug in 2026.1.3.
Debugging via console revealed that while voice_context holds the correct file path at Begin Routine, the Sound component’s internal value is undefined, meaning it never receives the dynamic variable at all. This suggests the Sound component is initializing before the variable is assigned, and “set every repeat” is not functioning online.
Attempting to construct the Sound object manually via a Code component:
javascript
voice_sound = new sound.Sound({
win: psychoJS.window,
value: voice_context,
secs: -1
});
played correctly on the first loop but not subsequent loops. Further debugging showed the psychoJS object reference becomes inconsistent across loops, and attempting to reset the sound status failed because PsychoJS.Status is undefined.
Workaround: Bypassing PsychoJS sound entirely and using the native Web Audio API resolved the issue:
javascript
if (typeof audioCtx === ‘undefined’) {
audioCtx = new AudioContext();
}
if (typeof voiceSource !== ‘undefined’) {
try { voiceSource.stop(); } catch(e) {}
}
voice_context_finished = false;
fetch(voice_context)
.then(response => response.arrayBuffer())
.then(buffer => audioCtx.decodeAudioData(buffer))
.then(decoded => {
voiceSource = audioCtx.createBufferSource();
voiceSource.buffer = decoded;
voiceSource.connect(audioCtx.destination);
voiceSource.onended = function() {
voice_context_finished = true;
};
voiceSource.start(0);
})
.catch(err => console.log("audio error:", err));
Questions for the community:
1 Is the grayed-out dropdown for dynamic Sound properties a known bug in 2026.1.3?
2 Is there a proper fix planned so that dynamic Sound components work reliably online without needing a Web Audio API workaround?
3 Is the inconsistent psychoJS object reference across loops a known issue?

