The Delay
class
- class audiomath.Delay(seconds, initialValue=False, finalValue=True)
Bases:
object
A callable object that can be assigned to one of the dynamic properties of a
Player
. It returns itsinitialValue
until the specified number ofseconds
has elapsed, then raises aStopIteration
exception containing itsfinalValue
. This will be caught by thePlayer
, causing it to replace the dynamic with the specified final static value.The following example causes a
Player
object to start playing automatically after a delay:import audiomath as am p = am.Player(am.TestSound('12'), synchronizeDynamics=False) p.playing = am.Delay(5) # will start playing 5 seconds from now