psychopy.org | Reference | Downloads | Github

Unknown resource error for sound files

URL of experiment:

Description of the problem:
I’m doing an experiment where participants have to listen to music and I keep getting this error.
I tried changing the path in the excel file(Acquisition2_sound_files) to resampled_files/Bartok1.wav but it’s still looking for local path. Please help!

It might be that you are still looking at a cached version of your experiment.

Use Developer Tools (Ctl-Shift-I in Windows/Chrome, Cmd-Opt-J in Mac/Chrome, F12 in IE/Edge, Ctrl-Shift-J in Windows/Safari, Ctrl-Opt-J in Mac/Safari) to view errors via the browser console if you aren’t getting sufficient information from PsychoPy. You can add print(var) (which translates to console.log(var); ) to check the value of a variable var at a particular point.

If Pavlovia refuses to run the latest upload of your experiment, disable the cache via Network conditions in the browser console.

Best wishes,

Wakefield

Hi Wakefield, thank you for your answer. I tried updating the cache (and then clearing it too) and now it’s showing the same error with the correct path (Resampled_files\Ligeti21.wav).I see the initial box downloading materials, but it’s giving me the same error. I went through the crib sheet and tried using the developer tools, but I wasn’t to find/solve the problem. Do you have any other ideas of things I can try?

Try using / instead of \ in your paths

It worked!! Thank you so much!

Ok, I have a follow up question: I’m working on an alternative version of this experiment that uses custom code and I’m having the same error. I just added in a snippet of code that downloads the sound files at the beginning of the experiment. I tried changing the orientation of the slashes but it is still not finding the files. Here is the error and the snap shots of my code:
image
Beginning of experiment:


This is in a code routine before a loop containing the routines actually playing the sound files:

Any ideas about what might be causing this error?
Here is the URL: Sign in · GitLab

Once you download the resources you don’t use the path to address them.

Cool. I think that fixed something. Now I’m getting another error:
Unfortunately we encountered the following error:

  • When finding a player for the sound
  • Could not find an appropriate player.

Along with a very red console

Any ideas on how to solve this?

I’m not sure but I notice that you are running psychoJS.downloadResources([{name: (sound_file),path:("…/Resampled_files/"+sound_file)} ]);

15 times. I found that it didn’t work when I ran it twice, so my working code for this is

if ((expInfo["condition"] === "1")) {
psychoJS.downloadResources([
{ name: (expInfo["participant"] + "s.jpg"), path: ("../faces/" + expInfo["participant"] + "s.jpg") },
{ name: (expInfo["participant"] + ".jpg"), path: ("../faces/" + expInfo["participant"] + ".jpg") }
]);
}
else {
    psychoJS.downloadResources([
{ name: "01F_HA_O.jpg", path: "../Nim-Face-Stimuli/01F_HA_O.jpg" },
{ name: "01F_NE_C.jpg", path: "../Nim-Face-Stimuli/01F_NE_C.jpg" }
]);
}

If you create an array, e.g. musicTracks=[]; and then push {name: (sound_file),path:("…/Resampled_files/"+sound_file)} to it 15 times then you could load all of the resources using a single downloadResources command.

The console should tell you if the resources download in the background correctly, I think in the verbose section

Amazing!!! It worked. Thank you so much for all your help! :grinning:

1 Like