Reply To: Maximum audio playbacks

PennController for IBEX Forums Support Maximum audio playbacks Reply To: Maximum audio playbacks

#10920
Jeremy
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