audio.wait
description
It waits until the previous command or command specified is executed or the specified time runs out before moving onto the next command.
syntax
getAudio(ELEMENT_NAME).wait()
alternate(s)
-
getAudio(ELEMENT_NAME).wait("first")
-
getAudio(ELEMENT_NAME).wait(test)
example(s)
@newAudio("sentence", "test.mp3")
@ .play()
@,
@newButton("validation", "Validate")
@ .print()
$ .wait()
@,
@getAudio("sentence")
$ .wait("first")
@,
@newText("thanks", "Thank you for listening")
@ .print()
- Starts playing the file test.mp3 and adds a button onto the screen. If the button is clicked before the audio is done playing for the first time, it waits until the end before printing the text Thank you for listening.