InitiateRecorder

PennController for IBEX Forums Support InitiateRecorder

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6596
    ginopino09
    Participant

    Hi Jeremy,

    I am having some trouble with InitiateRecorder()
    I tried my script (that I paste here after) in the code tester of you website and it does work, but when I try it in my PCIbex builder it does not. I cannor figure out why. Do you have any suggestions?
    Thank you

    Giorgio

    newTrial("mic",
     newVar("name"),
            
            newText("nombre", "\u00BF Cu\u00E1l es tu nombre o cu\u00E1les son las iniciales de tu nombre y apellido?").css({'font-size':'1.5vw'})
                .print("center at 50%", "middle at 50%"),
            newText("Pulsa Enter").css({'font-size':'1.5vw'}).print("center at 50%", "middle at 85%"),
            newTextInput("name").css({'font-size':'1.5vw'})
                .once()
                .print("center at 50%", "middle at 70%")
                .wait()
                .setVar( "name" )
                .log("Participant", getVar("participantsName")),
            
            clear(),
    InitiateRecorder("https://pcibex.bcbl.eu/hablacon/mediarecorder.php"),
        
            newText("initials")
                .before(newText("Muy bien ").css({'font-size':'1.5vw'}))
                .text(getVar("name")).css({'font-size':'1.5vw'})
                .after( newText(", ahora entramos en modo de pantalla completa").css({'font-size':'1.5vw'}))
                .print()
                
                ,
                
            newButton("Vale").css({'font-size':'1.5vw'})
                .print("center at 50%", "middle at 50%")
                .wait(),
                
            fullscreen()
            ,
      
            clear()
            ,
            newText("mm","Ahora di algo y escúchalo para verificar que el micrófono es compatible con el programa. </br>").css({'font-size':'1.5vw'}).print(),
            
            newMediaRecorder("audio")
            .css({'font-size':'1.3vw'})
            .print()
            .wait()
            .play()
            .wait("playback")
            ,
            
            newText("s", "¿Se escucha bien?").css({'font-size':'1.5vw'}).print(),
            newButton("yes","SI").css({'font-size':'1.5vw'}).print("center at 50%", "middle at 40%").wait(),
            clear()
         )
    #6599
    Jeremy
    Keymaster

    Hi Giorgio,

    Honestly I’m surprised your code worked anywhere: as explained in the documentation, InitiateRecorder creates a new trial, it shouldn’t be inserted inside a trial.

    Try this instead:

    Header(
        defaultText.css("font-size","1.5vw")
        ,
        defaultTextInput.css("font-size", "1.5vw")
        ,
        defaultButton.css("font-size","1.5vw")
    )
    
    newTrial("mic",
        newVar("participantsName").global()
        ,
        newText("nombre", "\u00BF Cu\u00E1l es tu nombre o cu\u00E1les son las iniciales de tu nombre y apellido?")
            .print("center at 50%", "middle at 50%")
        ,
        newText("Pulsa Enter")
            .print("center at 50%", "middle at 85%")
        ,
        newTextInput("name")
            .once()
            .print("center at 50%", "middle at 70%")
            .wait()
            .setVar( "participantsName" )
    )
    .log("Participant", getVar("participantsName"))
    
    InitiateRecorder("https://pcibex.bcbl.eu/hablacon/mediarecorder.php").label("mic")
    
    newTrial("mic",
        newText("initials")
            .before( newText("Muy bien ") )
            .text( getVar("participantsName") )
            .after( newText(", ahora entramos en modo de pantalla completa") )
            .print()
        ,
        newButton("Vale")
            .print("center at 50%", "middle at 50%")
            .wait(),
            
        fullscreen()
        ,
        clear()
        ,
        newText("mm","Ahora di algo y escúchalo para verificar que el micrófono es compatible con el programa. ")
            .print()
        ,
        newMediaRecorder("audio")
            .css({'font-size':'1.3vw'})
            .print()
            .wait()
            .play()
            .wait("playback")
        ,
        newText("s", "¿Se escucha bien?").print()
        ,
        newButton("yes","SI")
            .print("center at 50%", "middle at 40%")
            .wait()
    )

    NB: I use defaultElement commands in the Header to play with the default font sizes, but you should really use a CSS file instead.

    Jeremy

    #6601
    ginopino09
    Participant

    Thank you Jeremy!
    I don’t know why it worked as it was before. I used inside a trial for my previous experiment too and it worked… who knows
    Anyway you solved my problem

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