Loading sounds on the fly

Hi Wakefield,
I’m still a little confused about this, but it looks like everything in the html/resources folder is automatically downloaded (unless you change the js code), and everything else is ignored. If you then insert

psychoJS._serverManager.downloadResources([
{ name: [filename], path: [filename+(path relative to html folder) OR (web address)] }
]);

at the beginning of a routine, you can use the file [filename] after that. BUT… I’ve been pulling files from another website, and it takes time to get the file, and the code does not wait for the file to load, so there needs to be a sufficient delay between the download call and the use of the file.

That’s all I’ve figured out so far.

Thanks for your help earlier, hope I’m being helpful here!
Jon

PS. Now I’m not sure there’s actually a problem with the regular psychoJS.downloadResources command – I think it was just a problem with it blocking as described here:

But now that I’ve got it working, I’ll just stick with psychoJS._serverManager.downloadResources. Call me superstitious.