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.

VoiceRecorder element

The VoiceRecorder element is deprecated since PennController 1.8. See the MediaRecorder element instead.