| Reference | Downloads | Github

Unspecified Javascript Error Related to Sounds

Start/stop of the sound using code did not work for my purposes. I am trying to play the feedback sound from the previous trial at the beginning of the next trial, but only for the first 0.1 sec, without stopping the rest of the trial. When I did this in code it would not play consistently (it is a reaction time experiment), and when I tried to have a separate routine that played feedback with the stimulus onscreen it started dropping frames.

So ultimately I’ve concluded that there’s no way to choose between some kind of ISI and playing very short sounds consistently. I’ve therefore chosen to just have the ISI and only give feedback on some trials.

This seems like a pretty important missing feature in psychoJS that it’s impossible to play a simple tone for a specified duration without either a dedicated routine or a code component which may or may not be executed in a timely manner. But oh well, I have something that works well enough now.

I feel like a demo coming on.

Would a minimal version of this be, say, a fixation cross followed by a simple choice eg left and right arrow with a feedback sound at the beginning of the next routine during the fixation cross? I might try one sound as mp3 and the other as a pure frequency.

Yep, although to really address all the issues the feedback sound should be conditional on the response.

1 Like

Try this

I’ve coded all the notes used in Music Box to make a game version. Press the letter of the note that appears and it will play at the start of the next routine (with the specified duration, sharp and octave). If you press the wrong note then you’ll hear the note you press.