I gotta be honest, I have no clue anymore.
I know it was from a post like this: How to play and repeat stimuli after a manual click , but it had that var code
and var sound
in front of it, but I can’t seem to find said post anymore.
Or rather, this was how it originally was in python:
import psychopy.core as core
import psychopy.sound as sound
def playSound():
testaudio = sound.Sound('testaudio.wav', secs = 1)
testaudio.setVolume(1)
testaudio.play()
core.wait(.3)
and this is what it became in JS:
import * as core from 'psychopy/core';
import * as sound from 'psychopy/sound';
function playSound() {
var testaudio;
testaudio = new sound.Sound("testaudio.wav", {"secs": 1});
testaudio.setVolume(1);
testaudio.play();
core.wait(0.3);
}
which caused trouble because of the asterisks, and so I ended up with the var core
that you see now (with some help from a friend who knows a little more than me)
I’ve honestly been considering just throwing the audio testing routine out and get my participants to check their audio another way, because I keep suspecting this routine is the cause of all my woes.