From 93d73a2b4ebda329a0ee9988e65db1b64ec5933f Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 17 Sep 2002 02:37:32 +0000 Subject: [PATCH] fix for no sound enabled --- direct/src/interval/SoundInterval.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/direct/src/interval/SoundInterval.py b/direct/src/interval/SoundInterval.py index 5b8d68513c..70524eb0bd 100644 --- a/direct/src/interval/SoundInterval.py +++ b/direct/src/interval/SoundInterval.py @@ -52,28 +52,32 @@ class SoundInterval(Interval.Interval): t1 = t + self.startTime if (t1 < 0.1): t1 = 0.0 - self.sound.setVolume(self.volume) - self.sound.setTime(t1) - self.sound.setLoop(self.loop) - self.sound.play() + if self.sound != None: + self.sound.setVolume(self.volume) + self.sound.setTime(t1) + self.sound.setLoop(self.loop) + self.sound.play() self.state = CInterval.SStarted self.currT = t1 def privStep(self, t): if self.state == CInterval.SPaused: # Restarting from a pause. - self.sound.setVolume(self.volume) - self.sound.setTime(t) - self.sound.setLoop(self.loop) - self.sound.play() + if self.sound != None: + self.sound.setVolume(self.volume) + self.sound.setTime(t) + self.sound.setLoop(self.loop) + self.sound.play() self.state = CInterval.SStarted self.currT = t def privFinalize(self): - self.sound.stop() + if self.sound != None: + self.sound.stop() self.currT = self.getDuration() self.state = CInterval.SFinal def privInterrupt(self): - self.sound.stop() + if self.sound != None: + self.sound.stop() self.state = CInterval.SPaused