PennController for IBEX › Forums › Support › Maximum audio playbacks › Reply To: Maximum audio playbacks
October 26, 2023 at 11:11 am
#10920
![](https://www.pcibex.net/wp-content/uploads/2018/10/IMG_8365-e1540835663655-150x150.jpg)
Keymaster
Hello,
Use a Var element to keep track of how many times the Audio element was played:
newVar("nplayed", 0) , newAudio("audio", "file.wav") .callback( getVar("nplayed").set(v=>v+1) .test.is(3).success( getAudio("audio").remove() ) ) .print() , newButton("Next").print().wait()
Jeremy