PennController for IBEX › Forums › Support › InitiateRecorder
- This topic has 2 replies, 2 voices, and was last updated 4 years, 1 month ago by
ginopino09.
-
AuthorPosts
-
February 10, 2021 at 11:39 am #6596
ginopino09
ParticipantHi 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 youGiorgio
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() )
February 10, 2021 at 12:42 pm #6599Jeremy
KeymasterHi 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
February 11, 2021 at 6:25 am #6601ginopino09
ParticipantThank 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 -
AuthorPosts
- You must be logged in to reply to this topic.