Many audio stimuli in Safari

PennController for IBEX Forums Support Many audio stimuli in Safari

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6127
    abraver
    Participant

    I have an audio ABX experiment running with no issues in Chrome:
    https://expt.pcibex.net/ibexexps/abraver/Tyler2/experiment.html

    However I’m having issues in Safari, both on desktop and on mobile, which seems to be related to preloading of the audio files.

    There are two main blocks, each of which reads from a csv file stim1.csv / stim2.csv to find a list of audio files hosted remotely (http://aaronbraver.com/experiments/tyler1/audio/)

    In Safari, the first page of the experiment will load, but the browser freezes or (or at least gets very slow) when trying to fill in the fields on that page. On the attempts where the first page isn’t completely frozen, I can get to a trial that should load some audio, but it gets stuck on preloading.

    The debugger shows no errors, and the only things that come up in the JavaScript console are the expected 404s as it tries to find the audio files locally first.

    My guess is that this has something to do with preloading because if I modify the stim1/stim csv files to list, say, 1/4 as many stimuli, everything loads nicely. I haven’t found the exact number of stimuli that causes things to go wrong, but in total there are 72 items * 2 blocks, plus 3 practice items, each wav file being about 300kb, putting the total somewhere just shy of 50mb.

    Any suggestions would be appreciated.

    #6128
    Jeremy
    Keymaster

    Hello,

    Unfortunately this is a known problem with Safari, which consecutive releases of PennController try to address with more or less (emphasis on less) success…

    I’ll try to rethink the preloading method again for the next release, but in the meantime you should definitely package your audio files in one or several zip archives—you shouldn’t have any problem with that since you’re already hosting your resources on a dedicated server. Follow this guide for instructions, and don’t hesitate to ask any questions you might have

    Jeremy

    #6129
    abraver
    Participant

    Thanks! Unfortunately the server is running Nginx (and that’s not something I can change). I don’t suppose you have the config for Nginx, do you? I’m playing with it at the moment and haven’t had success yet.

    #6130
    abraver
    Participant

    I gave up on myself too soon! The following works for me, in case anyone else has an Nginx server:

    location ~* /experiments {
            add_header 'Access-Control-Allow-Origin' 'https://expt.pcibex.net';
            add_header 'Access-Control-Allow-Methods' 'GET';
            add_header 'Access-Control-Allow-Headers' 'X-Accept-Charset,X-Accept,Content-Type';
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.