Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

External file source

Hi there,

I am designing an experiment that will be running on JATOS and includes presenting participants a number of small audio files. These are (or should be) selected from a pool of roughly 50000 files, which of course exceeds the maximum file size for somewhat smoothly running it by a lot.

Is there a way to access the files from an "external" source from which OpenSesame only grabs the ones required for a session? E.g. by retrieving the required files from a folder uploaded to JATOS and adding them to the file pool in every session through some inline script?

Many thanks and best regards,

Tim

Comments

  • krikri
    edited April 12

    Hi Tim,

    I can only speak from the JATOS side here. 50k files is a lot and although JATOS could probably handle them given a strong enough server, file serving is not what JATOS is specialised in. JATOS or JavaScript (and I hope OSWeb too) don't care where the files are loaded from - it's just a different URL. I'd suggest to use some professional file serving like AWS' S3 for this amount of files. Or if the cloud is not an option set up an Apache or Nginx (or any other file server) on your own machine.

    Edit: maybe even JATOS can handle this. What's the size of the 50k files altogether? And how much would you load per study run?

    Best

    Kristian

    Buy Me A Coffee

  • edited April 12

    Hi Kristian,

    thanks for the fast reply. Well in that case the question narrows down to whether OSWeb allows fetching files from external sources (and maybe how to do that).

  • Hi @TOS21 ,

    In principle, in an inline_javascript you should be able to read an audio sample from a URL (using fetch() ) and play it (using an AudioContext ). However, this will take some figuring out (I have never done this myself), and you're also likely to run into the same-origin policy, which usually prevents you from reading data from other domains (i.e. server A cannot read from server B).

    You're saying that, for each participant, you want to randomly a subset of audio files from a larger set of 50,000 files, right? I'm assuming that this subset is small enough to fit in the file pool of OpenSesame. (A practical limit, imposed by the browser, seems to be around 1,000 files.) So a pragmatic solution might be to create a number of different versions of the experiment, only differing in the files that are included in the file pool.

    Whether that's an acceptable solution of course depends on the specifics of your experiment!

    — Sebastiaan

    Buy Me A Coffee

  • I might be mistaken but I think the Same Domain Policy doesn't stop you here, at least not if you are just playing the content (https://stackoverflow.com/a/27431853/1278769).

    Buy Me A Coffee

  • @kri Ah, it seems you're right. I don't think this is of much use @TOS21 right now (because it would still take a fair bit of programming to accomplish this), but this might open the possibility of allowing remote URLs for stimuli (sound and images) in OSWeb. Something to keep on the radar!

    Buy Me A Coffee

  • I'm assuming that this subset is small enough to fit in the file pool of OpenSesame. (A practical limit, imposed by the browser, seems to be around 1,000 files.) So a pragmatic solution might be to create a number of different versions of the experiment, only differing in the files that are included in the file pool.

    If fetching the audio files from our servers proves to be too complicated, this might indeed be the way to go. I was just hoping that I could avoid this option as it would not be optimal (and would also require a lot of thought).

    Many thanks for your advices - I will post here if fetching the files worked.


    Best,

    Tim

  • Update:

    I found a really easy solution that seems to work for our purposes. We uploaded the relevant files to our server and an inline_script with following content in the block loop did the job:

    vars.url = ###generated URL based on random selection###
    vars.audiosample = new Audio(vars.url);
    vars.audiosample.play();
    // also get sample duration to calculate RT
    vars.sample_duration = vars.audiosample.duration*1000
    

    We converted the files to .ogg, reducing their sizes to a few kbs and therefore taking absolutely no time to load.

    Hope this might help anyone facing the same task.


    Best,

    Tim

  • edited April 23

    @TOS21 That's perfect, thanks! I elaborated on this in this discussion.

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games