Sound intervals are much like the Func Interval
, which lets a function or method be called as part of a Sequence
or Parallel
. They allow a sound to be played as part of an Interval
. Unfortunately, they don't provide much functionality beyond that, and trying to loop a sound by putting it in a SoundInterval
and looping the Interval
doesn't work very well. Really, the only reason to use a sound interval is when we're using Sequence
and Parallel
to create long scripts that need sounds to play at certain parts in them, for example a cinematic sequence in a role-playing game. That's why we didn't use any in this chapter; we don't have any really complicated scripting going on. We already went over the sound interval constructor, but for the sake of completeness we'll repeat it here. This is taken from the Panda3D manual:
SoundInterval( mySound, loop = 0 or 1, duration = myDuration, volume = myVolume, startTime = myStartTime)