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 …
Wiki Category Archives:
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.