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 its initialValue until the specified number of seconds has elapsed, then raises a StopIteration exception containing its finalValue. This will be caught by the Player, 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