Last recording not saved

PennController for IBEX Forums Support Last recording not saved

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #7084
    jinyoungjo
    Participant

    Hello,

    In my experiment, recordings obtained from participants’ production of test sentences are saved to my server. The experiment consists of two blocks, and it seems that in the second block, the last recording is not saved. (I should expect to see 320 saved files, but I have only 319 files per participant; it turns out that the very last audio is missing.) Only two people participated in my experiment, and it happened for both of them.

    It is not clear to my why such problem arises, because I am using the same codes and same test sentences for both block 1 and 2. Here is a copy of some parts of my script (the label “experiment2” is the second block, which is followed by the “questionnaire1” in the experiment). Could you please identify the problem? Please let me know if you need further information.

    Template("items_target.csv", variable =>
        newTrial("experiment1",
    
        /*newText("begin","<p>아무 키나 누르시면 시작합니다.")
            .center()
            .settings.css("font-size","20px")
            .print()
        ,
        newKey("").wait(),
        
        getText("begin").remove(),*/
        
        newAudio(variable.audio).center().print()
        ,
        newText("\n")
            .settings.css("font-size","30px")
            .center()
            .print()
        ,    
        newText("test_sentence",variable.sentence)
            .settings.css("font-size","30px")
            .center()
            .print()
        ,
        newText("\n")
            .settings.css("font-size","30px")
            .center()
            .print()
        ,
        newButton("Start recording").center().print().wait()
        ,
        /*newTimer("ISI",500)
            .start()
            .wait()
        ,*/
        newText("recording", "Recording...")
            .settings.css("font-size","50px")
            .settings.css("color","red")
        ,
        newMediaRecorder("record","audio")
            .record()
            .log()
        ,
        newKey("")
            .callback(newTimer("buffer",500).start().wait(),getTimer("recording").stop())
        ,
        newText("\n").print()
        ,
        newButton("Stop recording").center().print().wait()
        ,
        getMediaRecorder("record")
            .stop()
        ,
        newText("\n").print()
        ,
        newButton("Next").center().print().wait()
        ,
        getText("test_sentence")
            .remove()
        )
        .log("type",variable.type)
        .log("finalC",variable.finalC)
        .log("ID", getVar("ID"))
        .log("noun",variable.noun_roman)
        .log("suffix",variable.suffix_roman)
        );
    
    Template("items_target.csv", variable =>
        newTrial("experiment2",
    
        /*newText("begin","<p>아무 키나 누르시면 시작합니다.")
            .center()
            .settings.css("font-size","20px")
            .print()
        ,
        newKey("").wait(),
        
        getText("begin").remove()
        ,*/
        newAudio(variable.audio).center().print()
        ,
        newText("\n")
            .settings.css("font-size","30px")
            .center()
            .print()
        ,    
        newText("test_sentence",variable.sentence)
            .settings.css("font-size","30px")
            .center()
            .print()
        ,
        newText("\n")
            .settings.css("font-size","30px")
            .center()
            .print()
        ,
        newButton("Start recording").center().print().wait()
        ,
        /*newTimer("ISI",500)
            .start()
            .wait()
        ,*/
        newText("recording", "Recording...")
            .settings.css("font-size","50px")
            .settings.css("color","red")
        ,
        newMediaRecorder("record","audio")
            .record()
            .log()
        ,
        newKey("")
            .callback(newTimer("buffer",500).start().wait(),getTimer("recording").stop())
        ,
        newText("\n").print()
        ,
        newButton("Stop recording").center().print().wait()
        ,
        getMediaRecorder("record")
            .stop()
        ,
        newText("\n").print()
        ,
        newButton("Next").center().print().wait()
        ,
        getText("test_sentence")
            .remove()
        )
        .log("type",variable.type)
        .log("finalC",variable.finalC)
        .log("ID", getVar("ID"))
        .log("noun",variable.noun_roman)
        .log("suffix",variable.suffix_roman)
        );
    
    newTrial("questionnaire2",
        newText("purpose", "<p>이 실험의 목적이 무엇이라고 생각하시나요?")
            .settings.css("font-size", "20")
            .print(),
        newTextInput("ExpPurpose").print().log(),
        newText("\n").print(),
        newButton("Next").center().print().wait()
        );
    
    
    newTrial("questionnaire1",
        newText("Q0_age", "<p>1. 귀하의 나이를 만으로 적어주세요.")
            .settings.css("font-size", "20")
            .print()
        ,
            newTextInput("Q0 Age").print()
            .before(newText("만 ").print())
            .after(newText(" 세").print())
            .print()
            .log()
        ,
        newText("Q0_gender", "<p>2. 귀하의 성별은 무엇입니까?")
            .settings.css("font-size", "20")
            .print()
        ,
            newTextInput("Q0 Age").print()
            .print()
            .log()
        ,
    

    (and so on…)

    Thank you very much for your help.

    #7086
    amilam
    Participant

    Hello,

    Have you tried using the Sequence command for initiating the order of your trials?

    #7088
    jinyoungjo
    Participant

    Yes, my sequence command looks like this: Sequence("welcome", "init", "soundtest", "instruction", "instruction2", sepWith("sendAsync",randomize("practice")), "instruction3", sepWith("sendAsync",randomize("experiment1")), "break", sepWith("sendAsync",randomize("experiment2")), "questionnaire1", "questionnaire2", "familiarity", SendResults(), "send")

    I tried switching sepWith("sendAsync",randomize("experiment1")) and sepWith("sendAsync",randomize("experiment2")), and this time, the recording in the final trial of “experiment1” is not saved.

    #7089
    amilam
    Participant

    What about adding the “break” right after both sepWith("sendAsync",randomize("experiment1")) and sepWith("sendAsync",randomize("experiment2"))?

    #7090
    jinyoungjo
    Participant

    That doesn’t work either, and I don’t really see a reason why it should work… Thank you for the suggestion, though!!

    #7092
    Jeremy
    Keymaster

    Hi,

    What version of PennController are you using? If you’re not using it already, I suggest you upgrade to 2.0.beta where I improved the uploading system

    In any case, you should probably add a non-async UploadRecordings trial just before the SendResults trial, to make sure all the recordings are uploaded before finishing the experiment

    Also, feel free to share your project’s URL to ease the troubleshooting process

    Jeremy

    #7093
    jinyoungjo
    Participant

    Hi Jeremy,

    Thank you very much for your reply!

    I thought my experiment was too long, so didn’t post a demo link. I have made a simplified version of it: https://farm.pcibex.net/r/MSSnpS/

    Could you please let me know how I could make the synchronous UploadRecordings? I’ve been searching the tutorial and the forum but haven’t found an example… could you please direct me to relevant resources or kindly teach me how to change the codes?

    Thank you.

    #7094
    jinyoungjo
    Participant

    Hello again,

    Adding UploadRecordings just before SendResults made it work! Now all the files are saved. Thank you so much!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.