psychopy.org | Reference | Downloads | Github

Issues with auditory stimuli


#1

URL of experiment: https://pavlovia.org/run/Jordan_Gallant/online-auditory-typing-task/html/

Description of the problem: The audio files load properly, however, instead of playing the audio file, a single tone is played for the entire duration of the audio component. Interestingly, if I try continue progressing through the trials, it never ends, even though there are only supposed to be 4 trials in the first practice block. This leads me to believe there is something odd going on with reading the conditions file. The experiment works fine offline, i.e. the python version. So, it could be there’s a bug in the PY to JS conversion code. Either way, I’m pretty stumped.

I’d appreciate some help with this, my deadline is coming up and I’d like to run this experiment using PsychoPy3.


#2

Hi @unagi_pie, would you mind posting your psyexp file? I try to run your experiment, but get a reference error for sounds, suggesting that sounds is a variable in the sound component that should be set to update on each repeat. Once that is fixed, perhaps I can see what is happening further on.


#3

online auditory typing task.psyexp (86.2 KB)

Hi @dvbridges, thanks for the quick response. I’d just been playing around with different settings on the sound component. In my most recent upload I forgot to set it to ‘update on each repeat’. I just made that adjustment and the result seems to be the same.

I’ve attached the updated psyexp file for you in any case.

Cheers


#4

Thanks, looking into it. The code seems ok, but the default sound that is written to initialise the sound is an ‘A’ note, but the JS code is playing a ‘C’ note. Will have to see what is happening with PsychoJS. Are the values in the spreadsheet ‘C’, or should there be wav files playing?


#5

There should be wav files playing.

Here’s an example of one of the four conditions files:

audioStimTrial1A.xlsx (10.3 KB)

I think I am hearing a C note when I run the JS version online. The PY version doesn’t do that though.


#6

@dvbridges You mentioned in another thread that you got a ‘file not found’ error for the sound file. I’m not getting that same error. I just get the default sound instead of the .wav file that should be playing.

Any idea what’s going on here?

Is there something wrong in my conditions file?

In the most recent version, I tried switching the direction of slashes in the relative path. audioStimTrial1A.xlsx (10.6 KB)


#7

I cannot really tell, because it could have been from a spelling error in a filename, or a missing file, or something else. I would use ‘/’ file separators in both columns rather than just the JS sound column.

Yes, I see - not playing the correct sound but instead seems to be playing a default sound - although the default sound is ‘A’ in Python. Need to check the PsychoJS lib. Looking into this now and will get back to you soon when I find out why your files are not playing.


#8

The problem is with your Excel file. There seem to be extra entries that are not actually visible to PsychoPy, but are being read as empty trials by the JS library. To demonstrate, change your practiceLoop to sequential, and you will have 4 practice trials, followed by the beeps. The beeps occur when there are no wav file enties to play, so it falls back on the default (at least, I think that is happening). To fix, copy only the wav file cells in the conditions sheet into a new sheet, being sure not to copy any empty cells and change the conditions file in your loop to point at this new file. Test, then, you can switch back to random trials and you should have random order of your sounds.

@jon, this is the same bug as Online experiment trials loop nested in the block loop not ended correctly from my email on Monday.


#9

@dvbridges

AWESOME! That works! I’ve been trying to get this experiment working online for the past 5 months. Thank you!