audio.settings.log

getAudio(id).settings.log() or getAudio(id).settings.log(“play”) or getAudio(id).settings.log(“pause”) or getAudio(id).settings.log(“end”) or getAudio(id).settings.log(“seek”) Tells to add a line in the results file each time an event happens. If you do not specify which event you want to log, all of them will add a line to the results file. “play” adds a line including a timestamp and an offset, …

audio.settings.once

getAudio(id).settings.once() Disables the buttons to play/pause the audio right after its first playing (the audio can still be played using the action play). Example: [js highlight=”5″ try=”true”]newText(“instructions”, “Please listen to the audio below”) .print() , newAudio(“sentence”, “test.mp3”) .settings.once() .print() .wait() , newButton(“validation”, “Validate”) .print() .wait()[/js] Adds some instruction text to the screen and control buttons …

audio.wait

getAudio(id).wait() or getAudio(id).wait(“first”) or getAudio(id).wait(test) Waits until the audio resource is done playing before evaluating and executing the next commands. If you call wait(“first”), then if the audio has already been played at least once by the time this command is evaluated, the next commands are evaluated and executed right away. If it was never …

audio.stop

getAudio(id).stop() (since beta 0.3) Stops the playback of the audio and goes back to the start of it, making it impossible to resume from the current position later. Example: [js highlight=”9″ try=”true”]newAudio(“sentence”, “test.mp3”) .play() , newTimer(“preview”, 750) .start() .wait() , getAudio(“sentence”) .stop()[/js] Starts playing the file test.mp3 and stops it after 750ms. Calling later on …

audio.remove

getAudio(id).remove() Removes the <audio> element from the screen, which contained buttons to control playback and volume. Example: [js highlight=”6″ try=”true”]newAudio(“beep”, “test.mp3”) .print() .wait() , getAudio(“beep”) .remove()[/js] Adds an interface to start/stop playing the audio file test.mp3 onto the screen, and removes it from the screen after the audio has been fully played.

audio.print

getAudio(id).print() Adds the <audio> element to the screen, containing buttons to control playback and volume. Example: [js highlight=”2″ try=”true”]newAudio(“test”, “test.mp3”) .print() .wait()[/js] Adds an interface with buttons to start/stop playing the audio file test.mp3 onto the screen.

audio.play

getAudio(id).play() or getAudio(id).play(“loop”) (since PennController 1.6) or getAudio(id).play(“once”) (since PennController 1.6) Starts playing the audio file. If you pass “loop” as a parameter, the audio will loop forever until the next stop command, or until play is called again, this time using the parameter “once”. Note that if you use play(“loop”), then stop playback using …

audio.pause

getAudio(id).pause() (since beta 0.3) Pauses the audio file. Example: [js highlight=”9″ try=”true”]newAudio(“sentence”, “test.mp3”) .play() , newTimer(“preview”, 750) .start() .wait() , getAudio(“sentence”) .pause() .print() .wait() [/js] Starts playing the file test.mp3, pauses it after 750ms, and shows controls on the screen making it possible to resume playback.

youtube.pause

getYoutube(id).pause() Pauses the video. Example: [js highlight=”10″ try=”true”]newYoutube(“mcgurk”, “aFPtc8BVdJk”) .print() .play() , newTimer(“preview”, 1000) .start() .wait() , getYoutube(“mcgurk”) .pause() [/js] Starts playing a mind-blowing video demonstrating the McGurk effect, waits 1 second and pauses the video.