audio.play
description
Starts playing the audio file.
syntax
getAudio(ELEMENT_NAME).play()
alternate(s)
-
getAudio(ELEMENT_NAME).play("loop")
-
getAudio(ELEMENT_NAME).play("once")
notes
- If you pass
"loop"
as a parameter, the audio will loop forever until the nextstop
command, or untilplay
is called again, this time using the parameter"once"
. Note that if you useplay("loop")
, then stop playback usingstop
and useplay()
again later (that is, without passing"once"
as a parameter) the audio will loop again.
example(s)
@newAudio("test", "test.mp3")
$ .play()
@ .wait()
- Starts playing the file test.mp3 (nothing is added onto the screen).