The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).wait() or getVoiceRecorder(id).wait(“first”) or getVoiceRecorder(id).wait(“playback”) (since PennController 1.1) Waits for the current (or next) recording to be over. If you pass “first” and a recording had already been done by the time this command get evaluated and executed, the commands that come next are immediately …
Wiki Category Archives:
voicerecorder.stop
The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).stop() Stop recording audio / playing last recording. Example: [js highlight=”12,20″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newVoiceRecorder(“recorder”) .record() , newTimer(“recording”, 3000) .start() .wait() , getVoiceRecorder(“recorder”) .stop() .play() , newTimer(“preview”, 1000) .start() .wait() , getVoiceRecorder(“recorder”) .stop() );[/js] Will start recording audio and stop recording after 2s, then play back …
voicerecorder.record
The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).record() Starts recording audio. Example: [js highlight=”5″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newVoiceRecorder(“recorder”) .record() , newTimer(“recording”, 2000) .start() .wait() , getVoiceRecorder(“recorder”) .stop() .play() .wait(“playback”) );[/js] Will record audio for 2s and then play it back.
voicerecorder.play
The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).play() Starts playing the last recording (if any). Example: [js highlight=”13″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newVoiceRecorder(“recorder”) .record() , newTimer(“recording”, 2000) .start() .wait() , getVoiceRecorder(“recorder”) .stop() .play() .wait(“playback”) ); [/js] Will record audio for 2s and then play it back.
var.settings.log
getVar(id).settings.log() (since beta 0.4) or getVar(id).settings.log(“final”) or getVar(id).settings.log(“set”) Adds a line to the results file indicating the value of the Var element. Blank of “final” are equivalent and will add a line reporting the value of the Var element at the end of the trial. Passing “set” will add a line for each .set command …
var.settings.local
getVar(id).settings.local() (since beta 0.3) Makes the Var element accessible only from the script of the current PennController instance (default setting). If a Var element with the same named was made global before (using .settings.global()—see above) then the Var element reverts to being local (while keeping its current value), meaning that any further Var element with …
var.settings.global
getVar(id).settings.global() (since beta 0.3) Makes the Var element accessible from the script that has not been evaluated yet (=~ all the script below .settings.global()). Note: any newVar command using the same id will be ignored if it comes further below the .global() setting command. This is particularly helpful when calling newVar in the Header, the …
var.set
getVar(id).set( value ) (since beta 0.3) or getVar(id).set( function ) Sets the Var element to the specified value. You can pass a function as value, which takes the current value of the Var element as an argument and should return the new value to which it will be updated. Example: [js highlight=”14″ try=”true”]defaultText .print() , …
tooltip.settings.text
getTooltip(id).settings.text( “string” ) (since beta 0.3) Resets the text of the tooltip. [js highlight=”12″ try=”true”]newAudio(“sentence”, “test.mp3”) .settings.log() .print() , newTooltip(“instructions”, “Use this interface to play and replay the audio as many times as you want”) .print( getAudio(“sentence”) ) , getAudio(“sentence”) .wait() , getTooltip(“instructions”) .settings.text(“Feel free to replay if you want”) [/js] Shows an interface to …
tooltip.settings.position
getTooltip(id).settings.position(“position”) (since beta 0.3) Defines the relative position of the tooltip when it is attached to an element (bottom-right by default). If position contains top, the bottom edge of the tooltip will be aligned with the top edge of the element to which it is attached. If it contains middle, the vertical middle axis of …