浏览代码

fix for negative sound duration problem]

gregw 23 年之前
父节点
当前提交
d78a078649
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      direct/src/interval/SoundInterval.py

+ 1 - 1
direct/src/interval/SoundInterval.py

@@ -32,7 +32,7 @@ class SoundInterval(Interval.Interval):
         self.startTime = startTime
         # If no duration given use sound's duration as interval's duration
         if duration == 0.0 and self.sound != None:
-            duration = self.sound.length() - self.startTime
+            duration = max(self.sound.length() - self.startTime, 0)
             if (duration == 0):
                 self.notify.warning('zero length duration!')
             # MPG - hack for Miles bug