Resources cannot be downloaded

OS : Mac Mojave 10.14.4
PsychoPy version v2020.2.4:
Standard Standalone? (y/n) Yes
**What are you trying to achieve?:**Digit span task, two conditions, presented visually and using audio

What did you try to make it work?: Read all the existing posts and fixes, and tried them all. Checked all file extensions in conds files. Re-encoded problem files.

What specifically went wrong when you tried that?:

Unfortunately we encountered the following error:

when downloading the resources for experiment: DS1
unable to download resource: stims/ADS4.wav (4)

The files are in the git repo, I have tried Beccaā€™s advice of manually adding them in the Online tab in the settings. I have re-encoded the problematic files (from m4a to wav) and they are all Mono 44.1khz, 16bit sample

I have tried Firefox/Chrome/Safari in pilot mode in case it was a browser issue

It runs locally, but not online, there are 24 .wav files.

Link to git https://gitlab.pavlovia.org/LiverpoolHope/ds1

Any thoughts would be gratefully received.
Best wishes
Glen

Hi Glen,

I think the issue is the path youā€™re using. The .js file is in the html folder and there is no ā€˜stimsā€™ subfolder there (the stims are in the stims folder, a subfolder of the root). Try and remove ā€˜stimsā€™ from the path in your components?

-Sabine

I donā€™t have any components that ref the stims folder. They all ref the condsFile so in the components it links to $audio.
I have uploaded the stims in the resources folder in the html folder.

Iā€™m sorry if I am not understanding correctly.

Glen

Ah, in that case: remove the ā€˜stims/ā€™ part from the path that youā€™ve written in the conditions file. Your experiment is now trying to locate a stims subfolder in the html folder when you try to run the exp online (there is no stims folder in the html folder).

Hello Glen,

you might want to clean up your directory and file-structure :wink: There is ā€œstimsā€-folder in the root-folder of your experiment, then there is a stims-folder in the html-folder and a stims-folder in html-resources folder. In addition, your xlxs-condtion files appear in various folders (root, html-resources). This might help to maintain the experiment.

Best wishes Jens

1 Like

Iā€™ve deleted the exisiting and done a clean upload.

The stims folder in the root is there for the local run, and the one in the rewsources is there for the js.

However I am getting an error on upload when I create a new project. If I sync again, it seems fine and the error is no longer there.

Traceback (most recent call last):
  File ā€œ/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/pavlovia_ui/project.pyā€, line 161, in submitChanges
AttributeError: ā€˜NoneTypeā€™ object has no attribute ā€˜projectā€™

New git repo Glen Pennington / DSV2 Ā· GitLab

Hello Glen,

ok, here my setup. In the experiment root-folder, there is the psyexp-file, the excel-file controlling the loop and a folder (stim) containing my stimuli. When syncing, the repo reflects the local folder-structure.

Here is a toy-experiment as example
stimuli.xlsx (8.4 KB) taudio.psyexp (4.4 KB)
The audio files should go in a folder called stim

Best wishes Jens

Hi
Thanks,

I have exactly this in my $condsfile. I have another excel file controlling the outer loops ( 1 block with visual stimuli, and 1 block with audio stimuli)

I canā€™t see that there is anything different in mine versus yours, other than the obvious outer loop.

I am probably missing something really obvious here and am feeling pretty dumb right now!

I think I am going to redo it piece by piece and see if I can get it working.

Thanks for the comments folksā€¦anyone else got anything else that might help?
Glen

Hello Glen,

do you mind posting your experiment along with the xlxs-files?

Well, one might say as long as the experiment runs the way you want it, donā€™t care. It is more a matter of maintenance.

Best wishes Jens

Hi,
Thanks for taking the time to assist.
choose_digitSpan is the firts conds file that controls the outer loops (the blocks: visual/audio), three .xlsx is the conds file for the first set of trials (three audio files
which would be in a stims folder)

I had a bit of a catastrophe with this yesterday as I am rejigging the course I have written for UGs and the whole thing kept crashing on me. I finally got it up and running again just now.

(EDIT: This works locally, and I have tried every solution I have seen on the forum for similar problems)

Best wishes
Glen
choose_digitSpan.xlsx (8.6 KB) three.xlsx (8.7 KB) Digit Span Task.psyexp (46.4 KB)

I may have something in the .js script. Could be way off the mark, but I was trying a super basic version on a new .psyexp and the default in the sound component/sound setting is A

In my exp I have that set to $audio from my conditions file, which has the sound files specified.

  // Initialize components for Routine "InstructionsA"
  InstructionsAClock = new util.Clock();
  // Initialize components for Routine "presA1"
  presA1Clock = new util.Clock();
  presA1audio = new sound.Sound({
    win: psychoJS.window,
    value: 'A',
    secs: (- 1),
    });

EDIT: Nopeā€¦I can see later on in the .js that it does ref the audio

Hello Glen,

  1. In your block presenting the audio-files you need to correct the join-command in the JS-part of your code-element check_keysA (see Wake Carterā€™s crib sheet). Set code-type from Auto->JS to both.

  2. In your visual block (set to 0 loops at the moment) you are referring to trialsA in your feedback-routine. However, trialsA appears after the feedback to the visual stimuli when the auditory stimuli are presented. Notice that edits in a routine are reflected in all copies of that routine. So, you might want to create separate feedback-routines.

  3. In the experiment-setting you set the an out-folder (tab online) which you do really need any longer. This setting creates a folder named html copying all stim-files aso. to the html-folder.

  4. In addition, you added the wav-files via additional resources for upload. There is no need to do this. But this also results in uploading the wav-files another time.

Not that the program is already running :pensive: :disappointed: So for instance, PsychoPy append does not work on-line and has to be manually corrected (Array.prototype.append = [].push; see the crib sheet). But the program will be running soon. :grinning:

Best wishes Jens

Hey, thanks.
Iā€™d just caught the trialsA things myself (when running locally I had that loop set to 0 reps) so that caught me out.

Iā€™ll work through the rest now and see what I can do! I am not great with the js stuff, Iā€™ve looked at this long enough now that I know what it is doingā€¦ishā€¦

thank you again.

glen

Hi again,
Iā€™m putting my hands up here and telling you Iā€™m really not confident with the code elements and js.

  1. I think I have done this, but I could be completely wrong.
    The join command in python is
    # Store each response in list allResponses.append(correct)

and in JS
allResponses.prototype.append = [].push;

Am I missing something there? Based on the crib sheet I have also added a code_JS file on the first routine with

thisExp=psychoJS.experiment;
win=psychoJS.window;
event=psychoJS.eventManager;
Array.prototype.append = [].push;
  1. Is fixed
  2. So if I understand correctly, I do not need to do this? Iā€™ve not specified an output for html now based on this understanding.
  3. Iā€™ve changed that, thanks

It is still not finding the .wav stimuli.
Experiment URL
Git Repo

I know I am a pain in the rear end, but I have reached my own limits with this one.

EDIT : done this and it works in Safari now (well begins to run at least and says all resources downloaded Wav file issue in safari but still nada in chrome/Firefox

Hello Glen,

the html-folder was a requirement in earlier PsychoPy versions. This is no longer needed but can still be used.

What do you want to achieve in this experiment? A visual and an auditory digital span block in this order? Do you want to register the RT of all key-presses or just the correctness of the response?

At the moment, your on-line version stops after registering the participantā€™s info with a screen displaying participant info in black.

Best wishes Jens

The two blocks will be (eventually) randomised and its a within p design so ptp will do both conditions. Only need correct/incorrect and that is taken from the digits and audiodigits columns in the excel file. Thios is where the join comes in.

The participant info screen needs to be edited with student information/consent etc, but responds to a space (in safari only). and beyond that it is pulling an error about the append code.

Thanks

For reference for anyone else with similar issues.
It would appear that my adblocker was problematic on Firefox (presumably any adblocker on any browser) hence resources not downloading. So nothing wrong with the stims/referencing stims/condsfiles etc.

There were some other issues and one in particular is that audio files were not playing all the way through. I am in the process of rerecording the audio to extend the duration with blank space at the end of the file, hopefully this will resolve that.

I had thought this was fixed by changing the sound to ptb and changing latency to not critical, but it wasnā€™t a fix all. Still some work to do.

Thanks to those who have helped (especially Kris via Nicola on Friday when I was about reaady to pop!

Glen

Hello Glen,

good that you solved the problem. Do you mind telling us which addblocker you have been using?

Best wishes Jens

Hi Jens
I use AdBlocker Plus for Firefox (on Mac).
Best wishes
Glen