Unable to download resources: auditory stimuli online

URL of experiment: https://gitlab.pavlovia.org/hollzzar/diss_exp1

Description of the problem: I have an experiment with two auditory tasks. I receive several “unable to download resource __ (4)” errors whenever I try to pilot this experiment. The resources that are named are different every time, but always appear after some resources appear to download successfully.

I have used Pavlovia already to run several smaller pilot studies for this experiment, so I am familiar with:

  • Listing all experimental lists and stimuli in Settings → Online → Additional Resources
  • Ensuring that filenames do not contain special characters
  • Keeping Settings → Online → Output path empty
  • Making sure there are no blank text objects

This experiment uses a 2 x 3 between-subjects design with 4 different counterbalancing orders, leading to a lot of stimuli (3780). I am wondering if I am over the limit that Pavlovia is able to handle. I have explored using Resource Manager and Static components to only load the necessary stimuli per subject, but I have not been able to figure out how to do that. The Static component causes the study to crash, I think because the conditions files are selected dynamically, but I’m not sure. Any guidance on my specific issue or using the components to conditionally load stimuli would be appreciated.

Hey,
Can you please share the project so we can have a closer look?
Right now, it’s set to private, so we cannot debug the issue.

Thanks,
Chen

I have updated the permissions, thank you!

Hello

this won’t solve your problem but mp3 is a sound format supported by most browsers, see here Resources in online studies — PsychoPy v2023.1.2 or here Cross-browser audio basics - Developer guides | MDN. Chrome does not yet (?) play wav AFAIK.

Best wishes Jens

Hello,

another suggestion Take a look at the resource manager-component. Resource Manager Component — PsychoPy v2023.1.2 Currently you ask your participants to download 330 mb. With the ressource manager your participants only download the stimuli they need.

Best wishes Jens

Hi Jens, the Resource Manager Component page recommends using a Static Component for between-subjects designs like mine, since any given subject only needs a fraction of the stimuli. I tried:

  • Adding a static period to the routine where each sound is played, following the instructions for the Static Component
  • Adding a static period to a new routine right before the one where each sound is played
  • Changing the length of the static period
  • Adding custom code to the Static Component to specify the duration of each sound file from the condition file

In all cases, I get “ReferenceError: secs not defined” when I run the study on Pavlovia.

I have also tried adding a Resource Manager Component inside the loop where the sounds are played, but this does not work. The Sound Component references the file column in the conditions file to get the sound file for each loop, but adding file to the Resource Manager Component leads to an error: “unable to download resource: file (file).”

Regarding wav vs. mp3, I did not have a problem running my pilot experiments on Chrome with wav files, though I suppose compressing the files will make them easier to load.

Hello,

I get the same error message as you do

grafik

If I use a static ISI and load the sound files in the static ISI period by setting set during: loadStim.ISI. loadStim is a static ISI of 500ms that I have defined. I was trying to load the sound file during the static ISI period. It works offline but not online.

This seems to be a bug (@TParsons). I have been using PsychoPy version 2022.2.5. Which version are you using?

Best wishes Jens

Hello,

at least no problems with wav in the Chrome browser. Older Safari-versions don’t play wav-files.

Best wishes Jens

I have been using version 2022.1.1 on macOS Big Sur version 11.6. I am wondering if upgrading to the most recent version of PsychoPy will allow me to use the Static Component, or create new problems.

For me, the Static Component doesn’t work offline at all. When I launch the experiment, it crashes, and the Runner shows: “Experiment ended with exit code 1 [pid:69882].”

Update: I upgraded to PsychoPy v2022.2.5 and can now use the Static Component when running the study locally on my laptop. However, I still receive the same error (“secs not defined”) when I run the study online.

Another update: I created a toy example of my experiment with a Static Component here. Again, this runs locally, but not online, suggesting that there’s an issue on the PsychoJS end.

I tried manually editing my test_static.js file to see if I could get a better sense of the issue. The command sound_1.setSound(file, secs=-1) on line 262 was the source of the issue (as an aside, I’m not sure why this command is being duplicated; deleting the second call on line 263 does not change anything).

When I looked at the Sound.js documentation, I noticed that the setSound function does not have a secs argument. When I removed it, leaving sound_1.setSound(file), I got a new error:

I then tried sound_1.setSound(sound_1, file) and go this error:

After some more trouble-shooting, I noticed that any sound-related commands like setVolume and getDuration threw errors after specifying setSound in this manner. This set of errors features what I imagine are base Javascript functions (this._player) that don’t actually appear anywhere in my test_script.js file.

Hello,

I am afraid that there it is a bug which means I cannot help you any further. Perhaps posting the problem on GitHub helps.

Best wishes Jens

Okay, thank you for trying to help me with this issue. I’ve just posted an issue on GitHub as you suggested.