getMediaRecorder(id).test.playing() (since PennController 1.8) Tests whether the recording is currently being played back.


getMediaRecorder(id).test.hasPlayed() (since PennController 1.8) Tests whether the recording was ever played back.


getMediaRecorder(id).wait() (since PennController 1.8) or getMediaRecorder(id).wait(“first”) or getMediaRecorder(id).wait(“playback”) Waits for the current (or next) recording to be over. If you pass “first” and a sample had already been recorded by the time this command gets evaluated and executed, the commands that come next are immediately evaluated and executed. Otherwise, it waits until a recording has …


getMediaRecorder(id).stop() (since PennController 1.8) Stops recording / playing the latest sample. Example: [js highlight=”12,22″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newMediaRecorder(“recorder”) .record() , newTimer(“recording”, 3000) .start() .wait() , getMediaRecorder(“recorder”) .stop() .disable() .print() .play() , newTimer(“preview”, 1000) .start() .wait() , getMediaRecorder(“recorder”) .stop() );[/js] Will start recording a video and stop recording after 2s, then play back the first second of …


getMediaRecorder(id).once() (since PennController 1.8) Disables the button to record after the first recording. You can still play back the recording, or programmatically start a new recording using the command record. Example: [js highlight=”5″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newMediaRecorder(“recorder”) .once() .print() .wait() .play() .wait(“playback”) );[/js] Adds a media player and a recording button to the page, and when …


getVoiceRecorder(id).log() (since PennController 1.8) 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 .log(), so you can identify it in the output archive. [js highlight=”2″]newMediaRecorder(“recorder”) .log() .print() .wait() [/js] Adds a …


getMediaRecorder(id).record() (since PennController 1.8) Starts recording. Example: [js highlight=”5″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newMediaRecorder(“recorder”,”audio”) .record() , newTimer(“recording”, 2000) .start() .wait() , getMediaRecorder(“recorder”) .stop() .play() .wait(“playback”) );[/js] Will record audio for 2s and then play it back.

getMediaRecorder(id).play() (since PennController 1.8) Starts playing the last recording (if any). Example: [js highlight=”15″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newMediaRecorder(“recorder”) .record() , newTimer(“recording”, 2000) .start() .wait() , getMediaRecorder(“recorder”) .stop() .print() .disable() .play() .wait(“playback”) ); [/js] Will record for 2s and then play back the recording.