Help with recording audio?

PennController for IBEX Forums Support Help with recording audio?

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #6359
    cpk47
    Participant

    Hello,

    I apologize for what I am sure is a stupid question, but I am having issues with setting up InitiateRecorder to record audio. I am unfamiliar with the process of setting up a server as is needed, but I thought I had figured it out and yet it still will not work.

    In the documentation, it says “You need to have access to a server where you can upload and execute a PHP file, and which will authorize the PHP file to upload ZIP files to a subfolder. Free web hosting services such as Dropbox or Google drive typically do NOT offer that option. Web hosting solutions that you access via FTP/SSH (e.g., Dreamhost) would typically do the job.” I am trying to set the server through Box, which you can access using FTP (https://support.box.com/hc/en-us/articles/360043697414-Using-Box-with-FTP-or-FTPS). So, I followed the instructions provided by Box using a program called FileZilla to access my Box account, but I do not know how to get a link to the PHP file. I can right-click the file in FileZilla and “Copy URL” but this gives me something beginning in “ftpes” not “https”. I tried this URL anyway but it gives me an error saying “MediaRecorder’s save URL is incorrect”. Is it possible to even use Box as a server for what I am trying to do? I have a colleague who has offered me his Dreamhost server for me to use, but I would prefer to use my personal premium Box account if I can. Is it more obvious how to get Dreamhost to work?

    I apologize if this a little off-topic since it involves several outside programs, but I have no idea where else to ask this question. I really appreciate any help. Thanks.

    #6360
    Jeremy
    Keymaster

    Hello,

    Unfortunately I don’t think Box supports PHP at the moment. It may be possible to use another API to handle the upload request that’s sent by PennController, but I never got around to trying that out because I only have access to Box through a university account, and administrators won’t grant access to the API for security reasons. If you are also using Box via an institution, I encourage you to inquire about it before spending too much time and energy on this. I can see why you’d rather not add another third party in the loop for data collection, but I have to say that using Dreamhost would definitely be much easier

    Let me know which route you end up deciding to go, I would be happy to provide assistance either way

    Jeremy

    #9676
    Larissa_Cury
    Participant

    Hi, Jeremy. This may be a very silly question, but still. Based on Pcibex’s documentation and the discussions here on the forum, there’s no way of hosting an experiment that records audio for free, right? We must have access to an external paid “driver” to host those files, right? There’s not free-server for that, right? A follow-up question is if the paid verson of Google Drive would do the job?

    #9679
    Jeremy
    Keymaster

    Hi,

    Amazon offers an “AWS Free Tier” plan which gives you free access to S3 and Lambda for 12 months. The PCIbex documentation has a page that describes how to send recordings to S3

    However, as you’ve probably noticed, the farm is suffering serious problems these days, so it’s unfortunately not the best time to set up a project on it

    Jeremy

    #9683
    Larissa_Cury
    Participant

    Thank you, Jeremy!
    12 months would be all right, that’s good news. I was afraid I’d have to buy a storage service! Another option would be to physically download each record locally on participants’ computer after the experiment, right? I’ve ran the pre-set projet and saw this option.

    Concerning Farm’s problems, yes, I’ve noticed them. I hope everything turns out fine soon 🙏🙏🙏 thanks for the notice as well 🙂

    #10531
    Larissa_Cury
    Participant

    Hi, @Jeremy!
    Would the paid version of Google Drive work?
    best,

    #10533
    Jeremy
    Keymaster

    Hi,

    No, no version of Google Drive, or any other such out-of-the-box cloud storage option for the matter, will work. The destination platform needs to be able to accept (cross-origin) POST requests, which requires configuration options that only some services make available (eg. AWS or webservers with Apache + PHP, among others)

    EDIT: note that I am talking about Google Drive here, which is distinct from Cloud Storage (similar to AWS S3)

    Jeremy

    #10543
    Larissa_Cury
    Participant

    All right, got it! Many thanks! @Jeremy, How would it be possible to physically download each record locally on participants’ computer after the experiment? I’m planning to run my experiment locally, so maybe I won’t even have to send data to a database. 🙂 Hence, can I store the audios directly on my computer? If so, how?

    • This reply was modified 11 months, 2 weeks ago by Larissa_Cury. Reason: add tag
    #10547
    Jeremy
    Keymaster

    The experiment will automatically invite the participant to download an archive containing the recordings if upload fails. You can also use DownloadRecordingButton to manually insert a link in a trial of your own, but make sure to do so after the results have been sent to the server

    Jeremy

    #10549
    Larissa_Cury
    Participant

    Hi, Jeremy! That’s great, thank you! I’m sorry, why would this link be used for? I mean, what is the advantage of inserting a link in the button?

    #10550
    Jeremy
    Keymaster

    My bad, I shouldn’t have used the word “link”. DownloadRecordingButton returns a string of HTML code that represents a BUTTON HTML element, but that string needs to be parse to effectively add a BUTTON element to the page, which is why you need to pass it to newText for example. So you wouldn’t be inserting a link in a button, you would be inserting a BUTTON HTML element inside a Text PennController element, so the button can be added to the page for the participant to click, and download the archive containing the recordings

    Jeremy

    #10554
    Larissa_Cury
    Participant

    Ohhh, all right! Thank you! I’m trying to change the default text of the failure message, but it isn’t chaning…is there anything I could do? I can change the message on the button trial, but even if I change the message before it, it doens’t appear different in the experiment:

    
    newTrial(
        newFunction("check upload", ()=>PennController.uploadRecordingsError)
            .test.is()
            .success(
                newText("confirmation", "The recordings were sent to the server. ")
                    .print()
            )
            .failure(
                newText("error", "Click on the link below to store data 👇")  //////////////////////// HERE -> it doens't change!
                    .color("red")
                    .print()
            )
        // ,
        // newText("download", DownloadRecordingButton("Click here to download an archive of your recordings.") )
        //     .print()
        // ,
        // newTimer("inifinite", 0)
        //     .wait()
    )
    
    • This reply was modified 11 months, 2 weeks ago by Larissa_Cury. Reason: adding question
    • This reply was modified 11 months, 2 weeks ago by Larissa_Cury. Reason: add code
    #10558
    Larissa_Cury
    Participant

    Oh! @Jeremy , I’m going to get participant’s consent before the experiment, so how can I hide the consent audio page? (they will have already consented)

    #10561
    Jeremy
    Keymaster

    Hi,

    You cannot change the error message, as it is hard-coded in the MediaRecorder element. What you are doing is create a new trial, and printing a Text element in that trial depending on whether the upload succeeded or failed (note that the trial needs to come after the upload attempt for uploadRecordingsError to be set)

    You can change/set the consent text in the InitiateRecorder command, but you cannot omit that trial, because it is when the browser requests access to the recording device: without it it would simply be impossible to record anything

    Jeremy

    #10562
    Larissa_Cury
    Participant

    Hi, @Jeremy! Thanks ! See, I could change the message, but is it impossible to change the links’s message as well? I cannot have that amount of text, my participants are learning how to read, this can bias the experiment (this is a reading experiment and there will be a version in portuguese as well). Is there a way to change the link’s message too ? (or to turn it into a button, maybe) ?

    I’m refering to this msg: *By clicking this link I understand that I grant this experiment’s script access to my recording device for the purpose of uploading recordings to the server designated by the experimenter(s).*

    
    // 👉 Record audio
    
    InitiateRecorder("https://myserver/uploadVoices/saveRecordings.php"
    ,
    "Recording audio warning message here"
    )
    //.label("first-trial"));  // why is it here?
    
    // 👉  Experimental trial: 
    
    //Template("items.csv", row =>
        newTrial("experimental-trial",
    // newMediaRecorder(ELEMENT_NAME: string, ["audio"], ["video"])
        newMediaRecorder("recorder", "audio")
            .record()
        ,
        newTimer("recording", 3000)
            .start()
           // .wait()
        ,
    .
    .
    .
    
Viewing 15 posts - 1 through 15 (of 19 total)
  • You must be logged in to reply to this topic.