Howdy, Stranger!

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

Supported by

Saving multiple files within one Worker

edited April 2020 in JATOS

Hello! I'm attempting to save multiple (potentially a rather large number) of wav files per participant. Is there a way to do this, or will it require that I save the raw audio data once and keep appending new data to it, then convert that to wav and parcel out each trial?

Also, I'm still in the process of trying to convert blobs to wav, so if anyone has any comments on how to do that in the context of then saving them individually to JATOS, they would be much appreciated! At the moment, it simply saves them into URL's that I then can't access, presumably because the JATOS docker (I'm using DigitalOcean and a private domain) stops me from doing so?

Comments

  • Hi!

    It's not clear to me whether you want to load those wav files into your experiment or upload them from your experiment to the JATOS server? If it's the latter one, there is an example study 'Video Recording' that does this (https://github.com/JATOS/JATOS_examples/raw/master/examples/video_recording.jzip), but only with one file, no with many.

    Another thing I don't understand yet, is that it 'saves them into URL's'. Anyway, JATOS (since 3.5.1) has the possibility to upload files http://www.jatos.org/Submit-and-upload-data-to-the-server.html.

    And for the wav format: I would not recommend to use wav format. It's just to big. I'd rather use some compressed format to save bandwith and more importantly time during download or upload.

    Best,

    Kristian

  • Hi Tres and Kristian,

    Just wanted to jump in here because I'm working on the same issue - trying to save (upload) multiple audio files per participant/component.

    Kristian, I didn't know about JATOS' uploadResultFile function - looks very useful, thanks! I have the same question as Tres about this: is it possible to upload multiple files per participant/component (i.e. sending the file from experiment to server)? Or just one? We're both working on experiments that use audio recording, and we need a way to send the audio data back to the JATOS server. The task is made up of several trials, so there will be lots of (small) audio recordings to send back. And like you said, the video recording example shows how to do this with one file (works great!) but we're not sure if this can work with multiple files?

    Tres, WRT your question about converting blobs to audio files, have you seen this post?: https://medium.com/jeremy-gottfrieds-tech-blog/javascript-tutorial-record-audio-and-encode-it-to-mp3-2eedcd466e78 So I think the problem is that, even when the Blob type is specified as something like 'audio/webm' or 'audio/mpeg-3', it still needs to be converted into a .wem or .mp3 file. I agree with Kristian that it would be better to convert the Blob into a compressed format like mp3 in JavaScript, before sending back to the server, but I'm not sure how to do this yet.

    Becky

  • Hi Becky, Hi Tres!

    you can upload multiple files with jatos.uploadResultFile. This feature was added to JATOS not long ago, with version 3.5.1 (so make sure to update both your local JATOS and your server). In 3.5.3 jatos.js got another update that mostly affect submit/append result data but also uploading result files: they are done in a background worker now and you don't have to care for them finishing (with callback functions or promises) before doing something else, e.g. going to the next component - jatos.js waits automatically until all result data and files are sent before moving on. This was especially a big problem with OSWeb but makes other experiments easier too. But anyway, all versions since 3.5.1 can handle multiple file uploads in the same component.

    What you have to pay attention to is the normal stuff when it comes to file uploads/downloads in the internet: they can take some time if they are big and the connection is slow. So you experiment can run nice and swift on your local JATOS, but then when you move to your JATOS server it gets laggy and this causes other problems like annoyed participants reloading the page. I'd recommend a feature from the Chrome browser to get a hunch of how your study will behave in the wild wild world: you can simulate the network connection, e.g. a slow 3G mobile phone connection.

    Best,

    Kristian

  • Hi Kristian,

    Thanks very much - this is super helpful! I haven't had a chance to try this yet, but when I do I'll let you know if I have any problems.

    Thanks again,

    Becky

  • I'd appreciate that :)

  • Following up on this post from my first attempts at writing javascript -- the answer was in making a dynamic name for the files, so each WAV file I posted was named differently and didn't overwrite the first. Something like

    filename = "name" + dynamicvbl + ".wav"

    Thank you all again for your help!

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