voicerecorder.settings.log

The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).settings.log() Will add a line whenever a recording starts and whenever it stops. Note that a line with the filename of the recorded sample is always logged anyway even if you do not call .settings.log(), so you can identify it in the output archive. [js …

voicerecorder.wait

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 …

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.test.is

getVar(id).test.is( value ) (since beta 0.3) or getVar(id).test.is( function ) Tests the value of the Var element. You can pass a function which takes the element’s value as its argument and returns true or false. Example: [js highlight=”20,21″ try=”true”]newVar(“trialsLeft”, 3) , newText(“remain”, ” Number of remaining attempts: “) .settings.after( newText(“trial”, “3”) ) , newTextInput(“guess”, “Guess …

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() , …